AutoYADM commit: 2024-12-26 15:15:02

This commit is contained in:
Daniel Fichtinger 2024-12-26 15:15:02 -05:00
parent a613baa1ee
commit 461b155d45
3 changed files with 18 additions and 25 deletions

View file

@ -0,0 +1,4 @@
vim.b.autoformat = false
vim.keymap.set("n", "<leader>test", function()
dd(vim.b.autoformat)
end)

View file

@ -7,14 +7,20 @@
-- but disable it for normal mode commands like `o` -- but disable it for normal mode commands like `o`
-- vim.g.prev_conceallevel = 0 -- vim.g.prev_conceallevel = 0
vim.api.nvim_create_autocmd("FileType", { -- vim.api.nvim_create_autocmd("FileType", {
pattern = "tex", -- -- pattern = "*.tex",
callback = function() -- pattern = "tex",
dd(vim.b.autoformat) -- callback = function(args)
vim.b.autoformat = false -- local buf = args.buf
dd(vim.b.autoformat) -- local b = vim.b[buf]
end, -- dd(b.autoformat)
}) -- b.autoformat = false
-- dd(b.autoformat)
-- vim.keymap.set("n", "<leader>test", function ()
-- dd(b.autoformat)
-- end)
-- end,
-- })
vim.api.nvim_create_autocmd({ "InsertLeave", "FileType" }, { vim.api.nvim_create_autocmd({ "InsertLeave", "FileType" }, {
-- pattern = "*", -- pattern = "*",

View file

@ -19,23 +19,6 @@ return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
optional = true, optional = true,
opts = { opts = {
-- format_on_save = function(bufnr)
-- local ignore_filetypes = {"tex"}
-- if vim.tbl_contains(ignore_filetypes, vim.bo[bufnr].filetype) then
-- return
-- end
-- -- Disable with a global or buffer-local variable
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
-- return
-- end
-- -- Disable autoformat for files in a certain path
-- local bufname = vim.api.nvim_buf_get_name(bufnr)
-- if bufname:match("/node_modules/") then
-- return
-- end
-- -- ...additional logic...
-- return { timeout_ms = 500, lsp_format = "fallback" }
-- end,
formatters_by_ft = { formatters_by_ft = {
-- requires install via AUR -- requires install via AUR
-- TODO: add to mason registry? -- TODO: add to mason registry?