There are some duplicates between ftplugins and put those in it
Add setup(opts) which:
runs on buffer that has file type and the file type is not included in opts.disabled list.
Keymap lsp related things using register_for_ftplugin()
Because some file type relies on LSP to format and others use dedicated
formatter, and it is cumbersome to remember and switch key sequence for
formatting (if it is done manually at all).
For auto formatting, you should be able to specify formatter if dedicated formatter should be used.
If vim.b.format variable which is a function is defined, call this in autocmd.
If it is nil, call lsp format.
How to disable formatting at all? (because plugin does it)
vim.b.auto_format_disabled ?
Summary
setup(opts)
which:opts.disabled
list.register_for_ftplugin()
vim.b.format
variable which is a function is defined, call this in autocmd.vim.b.auto_format_disabled
?