feat(nvim): update to v0.11
This commit is contained in:
		| @@ -1,40 +1,34 @@ | ||||
| return { | ||||
| 	"stevearc/conform.nvim", | ||||
| 	event = "BufWritePre", | ||||
| 	event = { "BufReadPre", "BufNewFile" }, | ||||
| 	opts = { | ||||
| 		lsp_fallback = true, | ||||
|  | ||||
| 		formatters_by_ft = { | ||||
| 			lua = { "stylua" }, | ||||
|  | ||||
| 			javascript = { "prettier" }, | ||||
| 			typescript = { "prettier" }, | ||||
| 			json = { "prettier" }, | ||||
| 			css = { "prettier" }, | ||||
| 			html = { "prettier" }, | ||||
|  | ||||
| 			sh = { "shfmt" }, | ||||
|  | ||||
| 			go = { "goimports", "gofumpt" }, | ||||
| 			php = { "php-cs-fixer" }, | ||||
| 			python = { "black" }, | ||||
| 		}, | ||||
|  | ||||
| 		-- format_on_save = function(bufnr) | ||||
| 		-- 	local filetype = vim.bo[bufnr].filetype | ||||
| 		-- 	if filetype == "javascript" then | ||||
| 		-- 		return nil | ||||
| 		-- 	end | ||||
| 		-- 	if filetype == "vue" then | ||||
| 		-- 		return nil | ||||
| 		-- 	end | ||||
| 		-- 	if filetype == "less" then | ||||
| 		-- 		return nil | ||||
| 		-- 	end | ||||
| 		-- 	if filetype == "php" then | ||||
| 		-- 		return nil | ||||
| 		-- 	end | ||||
| 		-- | ||||
| 		-- 	return { | ||||
| 		-- 		timeout_ms = 500, | ||||
| 		-- 		lsp_fallback = true, | ||||
| 		-- 	} | ||||
| 		-- end, | ||||
| 		format_on_save = false, | ||||
|  | ||||
| 		default_format_opts = { lsp_fallback = true }, | ||||
| 	}, | ||||
|  | ||||
| 	config = function(_, opts) | ||||
| 		require("conform").setup(opts) | ||||
|  | ||||
| 		-- manual formatting keymap | ||||
| 		vim.keymap.set({ "n", "x" }, "=", function() | ||||
| 			require("conform").format({ | ||||
| 				async = true, | ||||
| 				lsp_fallback = true, | ||||
| 			}) | ||||
| 		end, { desc = "Format file or range" }) | ||||
| 	end, | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Oliver
					Oliver