feat: use conform

This commit is contained in:
Adrien Waksberg 2024-04-15 11:32:16 +02:00
parent a576bf237a
commit 455b831f34
2 changed files with 11 additions and 22 deletions

View file

@ -1,15 +1,16 @@
local options = { local options = {
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, lua = { "stylua" },
-- css = { "prettier" }, bash = { "shfmt" },
-- html = { "prettier" }, sh = { "shfmt" },
md = { "mdformat" },
yaml = { "yamlfmt" },
}, },
-- format_on_save = { format_on_save = {
-- -- These options will be passed to conform.format() timeout_ms = 500,
-- timeout_ms = 500, lsp_fallback = true,
-- lsp_fallback = true, },
-- },
} }
require("conform").setup(options) require("conform").setup(options)

View file

@ -1,7 +1,7 @@
return { return {
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
-- event = 'BufWritePre', -- uncomment for format on save event = "BufWritePre", -- uncomment for format on save
config = function() config = function()
require "configs.conform" require "configs.conform"
end, end,
@ -20,27 +20,18 @@ return {
"williamboman/mason.nvim", "williamboman/mason.nvim",
opts = { opts = {
ensure_installed = { ensure_installed = {
-- lua stuff
"lua-language-server", "lua-language-server",
"stylua", "stylua",
-- web dev stuff
"css-lsp", "css-lsp",
"html-lsp", "html-lsp",
"typescript-language-server",
"deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
-- shell
"bash-language-server", "bash-language-server",
"shfmt", "shfmt",
"shellcheck", "shellcheck",
-- ansible
"ansible-language-server", "ansible-language-server",
"yaml-language-server", "yaml-language-server",
-- docker "yamlfmt",
"dockerfile-language-server", "dockerfile-language-server",
"mdformat",
}, },
}, },
}, },
@ -53,9 +44,6 @@ return {
"html", "html",
"css", "css",
"javascript", "javascript",
"typescript",
"tsx",
"c",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
}, },