Disable continuation of comments to the next line#91
Disable continuation of comments to the next line#91kasshedi117 wants to merge 1 commit intoThePrimeagen:masterfrom
Conversation
|
EDIT: Okay, you were right... and I think your PR is totally valid. Something was overwriting the format options. Credit to this guy here: It was the same ftp plugin, I think referenced by Telescope, which is setting the format options, and I suppose is loaded after init.lua stuff. If you want a lua-esque version, you can try this instead (note, this might not be the best/correct event to bind to, but it seems to work): -- disable continuing comments on next line
vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup('format_options', {}),
desc = 'Disable comment continuation on next line',
pattern = '*',
callback = function()
vim.opt.formatoptions:remove({'c', 'r', 'o'})
end
})
Explain: There are 2 relevant examples in the Neovim docs 1.)
2.)
You can also refer to the format options table for what the removal of these 3 options does:
|
vim.opt.formatoptions:remove("o") doesn't work, seems to be overrode by other plugin.