mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-07-22 03:34:31 +02:00
protected call for formatter.nvim
This commit is contained in:
parent
eceb656b4b
commit
359b6fd8e4
3 changed files with 8 additions and 5 deletions
1
init.lua
1
init.lua
|
@ -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.
|
vim.g.colors_name = O.colorscheme -- Colorscheme must get called after plugins are loaded or it will break new installs.
|
||||||
require "settings"
|
require "settings"
|
||||||
require "lv-utils"
|
require "lv-utils"
|
||||||
require "core.formatter"
|
|
||||||
|
|
||||||
-- TODO: these guys need to be in language files
|
-- TODO: these guys need to be in language files
|
||||||
-- require "lsp"
|
-- require "lsp"
|
||||||
|
|
|
@ -48,8 +48,12 @@ end
|
||||||
-- end
|
-- end
|
||||||
-- 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
|
if not O.format_on_save then
|
||||||
vim.cmd [[if exists('#autoformat#BufWritePost')
|
vim.cmd [[if exists('#autoformat#BufWritePost')
|
||||||
|
|
|
@ -82,9 +82,9 @@ return require("packer").startup(function(use)
|
||||||
-- Formatter.nvim
|
-- Formatter.nvim
|
||||||
use {
|
use {
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require "core.formatter"
|
require "core.formatter"
|
||||||
-- end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- NvimTree
|
-- NvimTree
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue