diff options
-rw-r--r-- | init.lua | 1 | ||||
-rw-r--r-- | lua/core/formatter.lua | 6 | ||||
-rw-r--r-- | lua/plugins.lua | 6 |
3 files changed, 8 insertions, 5 deletions
@@ -8,7 +8,6 @@ require "plugins" vim.g.colors_name = O.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs. require "settings" require "lv-utils" -require "core.formatter" -- TODO: these guys need to be in language files -- require "lsp" 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 |