Some zig nvim config changes

This commit is contained in:
2025-01-28 19:51:21 +02:00
parent 894c4deb84
commit d9ff1fdd46
3 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
Event = 'VeryLazy'
vim.opt_local.colorcolumn = '100'

View File

@@ -81,3 +81,23 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'TextChanged', 'InsertLeave' }, {
end
end,
})
vim.api.nvim_create_autocmd('BufWritePre', {
pattern = { '*.zig', '*.zon' },
callback = function(ev)
vim.lsp.buf.code_action({
context = { only = { 'source.fixAll' } },
apply = true,
})
end,
})
-- vim.api.nvim_create_autocmd('BufWritePre', {
-- pattern = { '*.zig', '*.zon' },
-- callback = function(ev)
-- vim.lsp.buf.code_action({
-- context = { only = { 'source.organizeImports' } },
-- apply = true,
-- })
-- end,
-- })

View File

@@ -134,6 +134,10 @@ return {
settings = {
zls = {
enable_build_on_save = true,
build_on_save_args = { '-Doptimize=ReleaseSafe', '-Darch=x86_64' },
inlay_hints_hide_redundant_param_names = true,
inlay_hints_hide_redundant_param_names_last_token = true,
warn_style = true,
},
},
}, -- zig