From bdba1538eeba8e548a3b6b65cd6ba6160db8d138 Mon Sep 17 00:00:00 2001 From: SamPosh Date: Fri, 5 May 2023 23:02:58 +0530 Subject: [PATCH] Create formatter.lua Black formatting added --- lua/custom/plugins/formatter.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lua/custom/plugins/formatter.lua diff --git a/lua/custom/plugins/formatter.lua b/lua/custom/plugins/formatter.lua new file mode 100644 index 00000000..7e7182f6 --- /dev/null +++ b/lua/custom/plugins/formatter.lua @@ -0,0 +1,15 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "mason.nvim" }, + opts = function() + local nls = require("null-ls") + return { + sources = { + nls.builtins.formatting.black.with({ + extra_args = {"--line-length=120", "--skip-string-normalization"}, + }), + }, + } + end, +}