summaryrefslogtreecommitdiff
path: root/lua/core/formatter.lua
diff options
context:
space:
mode:
authorChristian Chiarulli <[email protected]>2021-07-24 21:17:11 -0400
committerGitHub <[email protected]>2021-07-24 21:17:11 -0400
commit98f8a77819670ce6012216e01885c135a6d3a289 (patch)
treeb655da889c33e0eb89251878783700a8cd014a27 /lua/core/formatter.lua
parent0884dcd84670bc097c34253e983d2cde9c209dfa (diff)
New contract (#1080)
Changes to the global config object O is now lvim user_plugins is now plugins user_autocommands is now autocommands No more lang specific plugins Null-ls has replaced both formatter.nvim and nvim-lint
Diffstat (limited to 'lua/core/formatter.lua')
-rw-r--r--lua/core/formatter.lua60
1 files changed, 0 insertions, 60 deletions
diff --git a/lua/core/formatter.lua b/lua/core/formatter.lua
deleted file mode 100644
index c8f1baeb..00000000
--- a/lua/core/formatter.lua
+++ /dev/null
@@ -1,60 +0,0 @@
--- autoformat
-if O.format_on_save then
- require("lv-utils").define_augroups {
- autoformat = {
- {
- "BufWritePost",
- "*",
- ":silent FormatWrite",
- },
- },
- }
-end
-
--- -- check if formatter has been defined for the language or not
--- local function formatter_exists(lang_formatter)
--- if lang_formatter == nil then
--- return false
--- end
--- if lang_formatter.exe == nil or lang_formatter.args == nil then
--- return false
--- end
--- return true
--- end
-
--- returns default formatter for given language
--- local function formatter_return(lang_formatter)
--- return {
--- exe = lang_formatter.exe,
--- args = lang_formatter.args,
--- stdin = not (lang_formatter.stdin ~= nil),
--- }
--- end
-
--- fill a table like this -> {rust: {exe:"sth",args:{"a","b"},stdin=true},go: {}...}
--- local formatter_filetypes = {}
--- for k, v in pairs(O.lang) do
--- if formatter_exists(v.formatter) then
--- local keys = v.filetypes
--- if keys == nil then
--- keys = { k }
--- end
--- for _, l in pairs(keys) do
--- formatter_filetypes[l] = {
--- function()
--- return formatter_return(v.formatter)
--- end,
--- }
--- end
--- end
--- end
-local status_ok, _ = pcall(require, "formatter")
-if not status_ok then
- return
-end
-
-if not O.format_on_save then
- vim.cmd [[if exists('#autoformat#BufWritePost')
- :autocmd! autoformat
- endif]]
-end