zig.lua 660 B

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