Thomas 8 ماه پیش
والد
کامیت
083c6f860a
2فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 1 1
      lua/config/mappings.lua
  2. 8 1
      lua/plugins/conform.lua

+ 1 - 1
lua/config/mappings.lua

@@ -150,7 +150,7 @@ wk.add({
 		{
 			"<leader>fm",
 			function()
-				require("conform").format()
+				require("conform").format({ async = true, lsp_fallback = true })
 			end,
 			desc = "format files",
 		},

+ 8 - 1
lua/plugins/conform.lua

@@ -26,8 +26,15 @@ return {
 					"lsp_format",
 					stop_after_first = "fallback", -- Use fallback behavior
 				},
+				r = { "styler" },
+			},
+			formatters = {
+				styler = {
+					command = "R",
+					args = { "--slave", "-e", 'styler::style_text(readLines("stdin"))' },
+					stdin = true,
+				},
 			},
 		})
 	end,
 }
-