Created
November 19, 2025 10:51
-
-
Save lukerandall/1f5066f0c79ab60e022059c9f3d84b40 to your computer and use it in GitHub Desktop.
Disable markdown autoformatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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