From ac302b9b487063ef2bebb5742ddffd7a59b473bf Mon Sep 17 00:00:00 2001 From: Mike Fitzgerald Date: Mon, 16 Jan 2023 11:03:26 +0100 Subject: [PATCH] adding autoformat option --- README.md | 3 +++ lua/lazyvim/config/init.lua | 3 +++ lua/lazyvim/plugins/lsp/format.lua | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dd18716..daeffc34 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,9 @@ return { colorscheme = function() require("tokyonight").load() end, + lsp = { + autoformat = true, + }, -- icons used by other plugins icons = { diagnostics = { diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 26ee2f96..4b68e538 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -10,6 +10,9 @@ local defaults = { colorscheme = function() require("tokyonight").load() end, + lsp = { + autoformat = true, + }, -- icons used by other plugins icons = { diagnostics = { diff --git a/lua/lazyvim/plugins/lsp/format.lua b/lua/lazyvim/plugins/lsp/format.lua index 7fca9d31..473014d3 100644 --- a/lua/lazyvim/plugins/lsp/format.lua +++ b/lua/lazyvim/plugins/lsp/format.lua @@ -2,7 +2,7 @@ local Util = require("lazy.core.util") local M = {} -M.autoformat = true +M.autoformat = require("lazyvim.config").lsp.autoformat function M.toggle() M.autoformat = not M.autoformat