diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/core/formatter.lua | 6 | ||||
-rw-r--r-- | lua/plugins.lua | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lua/core/formatter.lua b/lua/core/formatter.lua index 50dcb654..06fcb56d 100644 --- a/lua/core/formatter.lua +++ b/lua/core/formatter.lua @@ -48,8 +48,12 @@ end -- end -- end -- end +local status_ok, formatter = pcall(require, "formatter") +if not status_ok then + return +end -require("formatter").setup {} +formatter.setup {} if not O.format_on_save then vim.cmd [[if exists('#autoformat#BufWritePost') diff --git a/lua/plugins.lua b/lua/plugins.lua index 85db0d0d..129bc91d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -82,9 +82,9 @@ return require("packer").startup(function(use) -- Formatter.nvim use { "mhartington/formatter.nvim", - -- config = function() - -- require "core.formatter" - -- end, + config = function() + require "core.formatter" + end, } -- NvimTree |