Skip to content

Instantly share code, notes, and snippets.

@lukerandall
Created November 19, 2025 10:51
Show Gist options
  • Select an option

  • Save lukerandall/1f5066f0c79ab60e022059c9f3d84b40 to your computer and use it in GitHub Desktop.

Select an option

Save lukerandall/1f5066f0c79ab60e022059c9f3d84b40 to your computer and use it in GitHub Desktop.
Disable markdown autoformatting
-- Project-specific Neovim configuration for jj
-- Disable autoformatting on *.md files
local function disable_md_autoformat()
-- Create an autocommand group for this project
local group = vim.api.nvim_create_augroup("JJProjectConfig", { clear = true })
-- Disable autoformat on markdown files
vim.api.nvim_create_autocmd("FileType", {
group = group,
pattern = "markdown",
callback = function()
-- Disable format on save for common formatting plugins
vim.b.autoformat = false
-- For null-ls/none-ls
vim.b.disable_autoformat = true
-- For conform.nvim
vim.b.conform_disable = true
-- For LSP formatting
vim.bo.formatexpr = ""
-- Disable auto-formatting option
vim.opt_local.formatoptions:remove({ "a", "t" })
end,
})
end
disable_md_autoformat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment