lukas-reineke / lsp-format.nvim

A wrapper around Neovims native LSP formatting.
559 stars 27 forks source link

support sync save for global #50

Open junnplus opened 2 years ago

junnplus commented 2 years ago

I need to set synchronization options for different filetypes, is there a way to set them globally?

lukas-reineke commented 2 years ago

No, there is no built in way to set options globally.

But you could script this pretty easly like so

local config = {}
for _, v in pairs(vim.fn.getcompletion("", "filetype")) do
    config[v] = { sync = true }
end
require("lsp-format").setup(config)