This commit is contained in:
asep komarudin 2023-02-19 16:10:17 +07:00
parent e52b14c920
commit 90d02a0f5b
5 changed files with 28 additions and 26 deletions

View file

@ -2,7 +2,7 @@
require("user.options")
require("user.keymaps")
require("user.autocommands")
require("user.format_onsave")
require("user.format")
-- require("user.colorscheme")
-- require("user.snip")
-- require("user.bufferline")

View file

@ -1,5 +0,0 @@
local M = {
disable = 0, -- 0 ( format jalan) 1 (fromat off)
}
return M

View file

@ -0,0 +1,5 @@
local M = {
disable = 1, -- 0 ( format jalan) 1 (fromat off)
}
return M

7
lua/user/format.lua Normal file
View file

@ -0,0 +1,7 @@
local data_exists, frmt = pcall(require, "custom.format_onsave")
if not data_exists then
require("user.format_onsave")
end
if frmt.disable == 0 then
require("user.format_onsave")
end

View file

@ -1,6 +1,3 @@
local data_exists, frmt = pcall(require, "custom.format_onsave")
if data_exists then
if frmt.disable == 0 then
function format_filter(client)
local filetype = vim.bo.filetype
local n = require("null-ls")
@ -23,5 +20,3 @@ if data_exists then
autocmd BufWritePre * lua vim.lsp.buf.format{timeout_ms=1000 ,filter=format_filter}
augroup end
]])
end
end