1
0

exclude zig from auto format

This commit is contained in:
Rokas Puzonas 2025-02-17 01:43:25 +02:00
parent 2661d89ed8
commit a11a0e6861

View File

@ -154,7 +154,7 @@ vim.api.nvim_create_autocmd('FileType', {
pattern = 'cpp', pattern = 'cpp',
callback = function(data) callback = function(data)
if data.file:match '%.h$' then if data.file:match '%.h$' then
vim.api.nvim_buf_set_option_value(data.buf, 'ft', 'c') vim.api.nvim_set_option_value('ft', 'c', { buf = data.buf })
end end
end, end,
}) })
@ -772,7 +772,7 @@ require('lazy').setup({
-- Disable "format_on_save lsp_fallback" for languages that don't -- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional -- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones. -- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true } local disable_filetypes = { c = true, cpp = true, zig = true }
local lsp_format_opt local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never' lsp_format_opt = 'never'