summaryrefslogtreecommitdiff
path: root/ftplugin/lua.lua
diff options
context:
space:
mode:
authorChristian Chiarulli <[email protected]>2021-07-13 21:13:55 -0400
committerGitHub <[email protected]>2021-07-13 21:13:55 -0400
commita097fa4c04e6db34bb409e0dea302c20629da8ec (patch)
treefb1c5bdd14cac82a363ea6c25b03a475050305f2 /ftplugin/lua.lua
parent04f9f53914a7dd999117ed73c5fa0ab3b0dc95e4 (diff)
LunarVim 0.4.8 (#919)0.4.8
Diffstat (limited to 'ftplugin/lua.lua')
-rw-r--r--ftplugin/lua.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua
index 2ffaa472..eb7b9944 100644
--- a/ftplugin/lua.lua
+++ b/ftplugin/lua.lua
@@ -1,3 +1,17 @@
+O.formatters.filetype["lua"] = {
+ function()
+ return {
+ exe = O.lang.lua.formatter.exe,
+ args = O.lang.lua.formatter.args,
+ stdin = not (O.lang.lua.formatter.stdin ~= nil),
+ }
+ end,
+}
+
+require("formatter.config").set_defaults {
+ logging = false,
+ filetype = O.formatters.filetype,
+}
if not require("lv-utils").check_lsp_client_active "sumneko_lua" then
-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
local sumneko_root_path = DATA_PATH .. "/lspinstall/lua"
@@ -31,17 +45,3 @@ if not require("lv-utils").check_lsp_client_active "sumneko_lua" then
},
}
end
-
-if O.lang.lua.autoformat then
- require("lv-utils").define_augroups {
- _lua_autoformat = {
- {
- "BufWritePre",
- "*.lua",
- "lua vim.lsp.buf.formatting_sync(nil, 1000)",
- },
- },
- }
-end
-
-vim.cmd "setl ts=2 sw=2"