From 740e27ec856cc688f0ecf0ffe2b55b26ce771407 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 7 Jul 2021 14:27:30 +0200 Subject: Add language support for linting and diagnostics --- .config/nvim/ftplugin/zig.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .config/nvim/ftplugin/zig.lua (limited to '.config/nvim/ftplugin/zig.lua') diff --git a/.config/nvim/ftplugin/zig.lua b/.config/nvim/ftplugin/zig.lua new file mode 100644 index 0000000..72ce8cb --- /dev/null +++ b/.config/nvim/ftplugin/zig.lua @@ -0,0 +1,14 @@ +-- Because lspinstall don't support zig yet, +-- So we need zls preset in global lib +-- Further custom install zls in +-- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS +require("lspconfig").zls.setup { + root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), + on_attach = require("cfg.lsp").common_on_attach, +} +require("cfg.utils").define_augroups { + _zig_autoformat = { + { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, + }, +} +vim.cmd "setl expandtab tabstop=8 softtabstop=4 shiftwidth=4" -- cgit v1.2.3-70-g09d2