zig.lua 577 B

1234567891011121314
  1. -- Because lspinstall don't support zig yet,
  2. -- So we need zls preset in global lib
  3. -- Further custom install zls in
  4. -- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS
  5. require("lspconfig").zls.setup {
  6. root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"),
  7. on_attach = require("lsp").common_on_attach,
  8. }
  9. require("lv-utils").define_augroups {
  10. _zig_autoformat = {
  11. { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' },
  12. },
  13. }
  14. vim.cmd "setl expandtab tabstop=8 softtabstop=4 shiftwidth=4"