618 lines
18 KiB
Lua
618 lines
18 KiB
Lua
-- ============================================================
|
|
-- SECTION 1: OPTIONS
|
|
-- Core Neovim settings, leaders, options
|
|
-- ============================================================
|
|
do
|
|
vim.loader.enable()
|
|
|
|
vim.g.mapleader = " "
|
|
vim.g.maplocalleader = " "
|
|
|
|
vim.g.have_nerd_font = true
|
|
|
|
vim.o.number = true
|
|
vim.o.relativenumber = true
|
|
vim.o.mouse = "a"
|
|
vim.o.showmode = false
|
|
vim.schedule(function()
|
|
vim.o.clipboard = "unnamedplus"
|
|
end)
|
|
vim.o.breakindent = true
|
|
vim.o.undofile = true
|
|
vim.o.ignorecase = true
|
|
vim.o.smartcase = true
|
|
vim.o.signcolumn = "yes"
|
|
vim.o.updatetime = 250
|
|
vim.o.timeoutlen = 300
|
|
vim.o.splitright = true
|
|
vim.o.splitbelow = true
|
|
vim.o.list = true
|
|
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
|
vim.o.inccommand = "split"
|
|
vim.o.cursorline = true
|
|
vim.o.scrolloff = 15
|
|
vim.o.confirm = true
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 2: KEYMAPS & AUTOCMDS
|
|
-- basic keymaps, basic autocmds
|
|
-- ============================================================
|
|
do
|
|
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
|
|
vim.diagnostic.config({
|
|
update_in_insert = false,
|
|
severity_sort = true,
|
|
float = { border = "rounded", source = "if_many" },
|
|
underline = { severity = { min = vim.diagnostic.severity.WARN } },
|
|
virtual_text = true,
|
|
virtual_lines = false,
|
|
jump = {
|
|
on_jump = function(_, bufnr)
|
|
vim.diagnostic.open_float({
|
|
bufnr = bufnr,
|
|
scope = "cursor",
|
|
focus = false,
|
|
})
|
|
end,
|
|
},
|
|
})
|
|
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
|
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
|
|
|
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
|
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
|
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
|
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
|
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
|
|
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
|
|
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
|
|
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
|
|
|
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
|
desc = "Highlight when yanking (copying) text",
|
|
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
|
callback = function()
|
|
vim.hl.on_yank()
|
|
end,
|
|
})
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 3: PLUGIN MANAGER INTRO
|
|
-- vim.pack intro, build hooks
|
|
-- ============================================================
|
|
do
|
|
local function run_build(name, cmd, cwd)
|
|
local result = vim.system(cmd, { cwd = cwd }):wait()
|
|
if result.code ~= 0 then
|
|
local stderr = result.stderr or ""
|
|
local stdout = result.stdout or ""
|
|
local output = stderr ~= "" and stderr or stdout
|
|
if output == "" then
|
|
output = "No output from build command."
|
|
end
|
|
vim.notify(("Build failed for %s:\n%s"):format(name, output), vim.log.levels.ERROR)
|
|
end
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd("PackChanged", {
|
|
callback = function(ev)
|
|
local name = ev.data.spec.name
|
|
local kind = ev.data.kind
|
|
if kind ~= "install" and kind ~= "update" then
|
|
return
|
|
end
|
|
|
|
if name == "telescope-fzf-native.nvim" and vim.fn.executable("make") == 1 then
|
|
run_build(name, { "make" }, ev.data.path)
|
|
return
|
|
end
|
|
|
|
if name == "LuaSnip" then
|
|
if vim.fn.has("win32") ~= 1 and vim.fn.executable("make") == 1 then
|
|
run_build(name, { "make", "install_jsregexp" }, ev.data.path)
|
|
end
|
|
return
|
|
end
|
|
|
|
if name == "blink.cmp" and vim.fn.executable("cargo") == 1 then
|
|
run_build(name, { "cargo", "build", "--release" }, ev.data.path)
|
|
return
|
|
end
|
|
|
|
if name == "go.nvim" then
|
|
if not ev.data.active then
|
|
vim.cmd.packadd("go.nvim")
|
|
end
|
|
pcall(function()
|
|
require("go.install").update_all_sync()
|
|
end)
|
|
return
|
|
end
|
|
|
|
if name == "nvim-treesitter" then
|
|
if not ev.data.active then
|
|
vim.cmd.packadd("nvim-treesitter")
|
|
end
|
|
vim.cmd("TSUpdate")
|
|
return
|
|
end
|
|
end,
|
|
})
|
|
end
|
|
|
|
---@param repo string
|
|
---@return string
|
|
local function gh(repo)
|
|
return "https://github.com/" .. repo
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 4: UI / CORE UX PLUGINS
|
|
-- guess-indent, gitsigns, which-key, colorscheme, todo-comments, mini modules, oil
|
|
-- ============================================================
|
|
do
|
|
vim.pack.add({ gh("NMAC427/guess-indent.nvim") })
|
|
require("guess-indent").setup({})
|
|
|
|
vim.pack.add({ gh("lewis6991/gitsigns.nvim") })
|
|
require("gitsigns").setup({
|
|
signs = {
|
|
add = { text = "+" }, ---@diagnostic disable-line: missing-fields
|
|
change = { text = "~" }, ---@diagnostic disable-line: missing-fields
|
|
delete = { text = "_" }, ---@diagnostic disable-line: missing-fields
|
|
topdelete = { text = "‾" }, ---@diagnostic disable-line: missing-fields
|
|
changedelete = { text = "~" }, ---@diagnostic disable-line: missing-fields
|
|
},
|
|
})
|
|
|
|
vim.pack.add({ { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } })
|
|
|
|
vim.cmd.colorscheme("catppuccin-macchiato")
|
|
|
|
vim.pack.add({ gh("folke/todo-comments.nvim") })
|
|
require("todo-comments").setup({ signs = false })
|
|
|
|
vim.pack.add({ gh("nvim-mini/mini.nvim") })
|
|
|
|
if vim.g.have_nerd_font then
|
|
require("mini.icons").setup()
|
|
MiniIcons.mock_nvim_web_devicons()
|
|
end
|
|
|
|
require("mini.ai").setup({
|
|
mappings = {
|
|
around_next = "aa",
|
|
inside_next = "ii",
|
|
},
|
|
n_lines = 500,
|
|
})
|
|
|
|
require("mini.surround").setup()
|
|
|
|
require("mini.pairs").setup()
|
|
|
|
local statusline = require("mini.statusline")
|
|
statusline.setup({ use_icons = vim.g.have_nerd_font })
|
|
|
|
---@diagnostic disable-next-line: duplicate-set-field
|
|
statusline.section_location = function()
|
|
return "%2l:%-2v"
|
|
end
|
|
|
|
vim.pack.add({ gh("stevearc/oil.nvim") })
|
|
require("oil").setup({
|
|
view_options = {
|
|
show_hidden = true,
|
|
},
|
|
})
|
|
vim.keymap.set("n", "-", "<cmd>Oil<CR>", { desc = "Open parent directory" })
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 5: SEARCH & NAVIGATION
|
|
-- Telescope setup, keymaps, LSP picker mappings
|
|
-- ============================================================
|
|
do
|
|
---@type (string|vim.pack.Spec)[]
|
|
local telescope_plugins = {
|
|
gh("nvim-lua/plenary.nvim"),
|
|
gh("nvim-telescope/telescope.nvim"),
|
|
gh("nvim-telescope/telescope-ui-select.nvim"),
|
|
}
|
|
if vim.fn.executable("make") == 1 then
|
|
table.insert(telescope_plugins, gh("nvim-telescope/telescope-fzf-native.nvim"))
|
|
end
|
|
|
|
-- NOTE: You can install multiple plugins at once
|
|
vim.pack.add(telescope_plugins)
|
|
|
|
require("telescope").setup({
|
|
extensions = {
|
|
["ui-select"] = { require("telescope.themes").get_dropdown() },
|
|
},
|
|
})
|
|
|
|
pcall(require("telescope").load_extension, "fzf")
|
|
pcall(require("telescope").load_extension, "ui-select")
|
|
|
|
local builtin = require("telescope.builtin")
|
|
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
|
|
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
|
|
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
|
|
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
|
|
vim.keymap.set({ "n", "v" }, "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
|
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
|
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
|
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
|
|
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
|
vim.keymap.set("n", "<leader>sc", builtin.commands, { desc = "[S]earch [C]ommands" })
|
|
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
group = vim.api.nvim_create_augroup("telescope-lsp-attach", { clear = true }),
|
|
callback = function(event)
|
|
local buf = event.buf
|
|
|
|
vim.keymap.set("n", "grr", builtin.lsp_references, { buffer = buf, desc = "[G]oto [R]eferences" })
|
|
|
|
vim.keymap.set("n", "gri", builtin.lsp_implementations, { buffer = buf, desc = "[G]oto [I]mplementation" })
|
|
|
|
vim.keymap.set("n", "grd", builtin.lsp_definitions, { buffer = buf, desc = "[G]oto [D]efinition" })
|
|
|
|
vim.keymap.set("n", "gO", builtin.lsp_document_symbols, { buffer = buf, desc = "Open Document Symbols" })
|
|
|
|
vim.keymap.set(
|
|
"n",
|
|
"gW",
|
|
builtin.lsp_dynamic_workspace_symbols,
|
|
{ buffer = buf, desc = "Open Workspace Symbols" }
|
|
)
|
|
|
|
vim.keymap.set(
|
|
"n",
|
|
"grt",
|
|
builtin.lsp_type_definitions,
|
|
{ buffer = buf, desc = "[G]oto [T]ype Definition" }
|
|
)
|
|
end,
|
|
})
|
|
|
|
vim.keymap.set("n", "<leader>/", function()
|
|
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
|
winblend = 10,
|
|
previewer = false,
|
|
}))
|
|
end, { desc = "[/] Fuzzily search in current buffer" })
|
|
|
|
vim.keymap.set("n", "<leader>s/", function()
|
|
builtin.live_grep({
|
|
grep_open_files = true,
|
|
prompt_title = "Live Grep in Open Files",
|
|
})
|
|
end, { desc = "[S]earch [/] in Open Files" })
|
|
|
|
vim.keymap.set("n", "<leader>sn", function()
|
|
builtin.find_files({ cwd = vim.fn.stdpath("config"), follow = true })
|
|
end, { desc = "[S]earch [N]eovim files" })
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 6: LSP
|
|
-- LSP keymaps, server configuration, Mason tools installations
|
|
-- ============================================================
|
|
do
|
|
vim.pack.add({ gh("j-hui/fidget.nvim") })
|
|
require("fidget").setup({})
|
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
|
callback = function(event)
|
|
local map = function(keys, func, desc, mode)
|
|
mode = mode or "n"
|
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
|
end
|
|
|
|
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
|
|
|
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
|
|
|
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
|
|
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
if client and client:supports_method("textDocument/documentHighlight", event.buf) then
|
|
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
|
buffer = event.buf,
|
|
group = highlight_augroup,
|
|
callback = vim.lsp.buf.document_highlight,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
buffer = event.buf,
|
|
group = highlight_augroup,
|
|
callback = vim.lsp.buf.clear_references,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("LspDetach", {
|
|
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
|
callback = function(event2)
|
|
vim.lsp.buf.clear_references()
|
|
vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf })
|
|
end,
|
|
})
|
|
end
|
|
|
|
if client and client:supports_method("textDocument/inlayHint", event.buf) then
|
|
map("<leader>th", function()
|
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
|
end, "[T]oggle Inlay [H]ints")
|
|
end
|
|
end,
|
|
})
|
|
|
|
-- Enable the following language servers
|
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
-- See `:help lsp-config` for information about keys and how to configure
|
|
---@type table<string, vim.lsp.Config>
|
|
local servers = {
|
|
clangd = {},
|
|
gopls = {},
|
|
pyright = {},
|
|
rust_analyzer = {},
|
|
ts_ls = {},
|
|
stylua = {},
|
|
jdtls = {},
|
|
lua_ls = {
|
|
on_init = function(client)
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
if client.workspace_folders then
|
|
local path = client.workspace_folders[1].name
|
|
if
|
|
path ~= vim.fn.stdpath("config")
|
|
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
|
then
|
|
return
|
|
end
|
|
end
|
|
|
|
local current_settings = client.config.settings --[[@as lspconfig.settings.lua_ls]]
|
|
client.config.settings.Lua = vim.tbl_deep_extend("force", current_settings.Lua, {
|
|
runtime = {
|
|
version = "LuaJIT",
|
|
path = { "lua/?.lua", "lua/?/init.lua" },
|
|
},
|
|
workspace = {
|
|
checkThirdParty = false,
|
|
library = vim.api.nvim_get_runtime_file("", true),
|
|
},
|
|
})
|
|
end,
|
|
---@type lspconfig.settings.lua_ls
|
|
settings = {
|
|
Lua = {
|
|
format = { enable = false },
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
vim.pack.add({
|
|
gh("neovim/nvim-lspconfig"),
|
|
gh("mason-org/mason.nvim"),
|
|
gh("mason-org/mason-lspconfig.nvim"),
|
|
gh("WhoIsSethDaniel/mason-tool-installer.nvim"),
|
|
})
|
|
|
|
require("mason").setup({})
|
|
|
|
require("mason-lspconfig").setup({
|
|
automatic_enable = false,
|
|
})
|
|
|
|
local ensure_installed = vim.tbl_keys(servers or {})
|
|
vim.list_extend(ensure_installed, {})
|
|
|
|
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
|
|
|
for name, server in pairs(servers) do
|
|
vim.lsp.config(name, server)
|
|
vim.lsp.enable(name)
|
|
end
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 7: FORMATTING
|
|
-- conform.nvim setup and keymap
|
|
-- ============================================================
|
|
do
|
|
-- [[ Formatting ]]
|
|
vim.pack.add({ gh("stevearc/conform.nvim") })
|
|
require("conform").setup({
|
|
notify_on_error = false,
|
|
format_on_save = function(bufnr)
|
|
local enabled_filetypes = {
|
|
-- lua = true,
|
|
-- python = true,
|
|
}
|
|
if enabled_filetypes[vim.bo[bufnr].filetype] then
|
|
return { timeout_ms = 500 }
|
|
else
|
|
return nil
|
|
end
|
|
end,
|
|
default_format_opts = {
|
|
lsp_format = "fallback",
|
|
},
|
|
formatters_by_ft = {
|
|
rust = { "rustfmt" },
|
|
python = { "isort", "black" },
|
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
go = { "goimports", "gofmt", stop_after_first = true },
|
|
},
|
|
})
|
|
|
|
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
|
require("conform").format({ async = true })
|
|
end, { desc = "[F]ormat buffer" })
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 8: AUTOCOMPLETE & SNIPPETS
|
|
-- blink.cmp and luasnip setup
|
|
-- ============================================================
|
|
do
|
|
vim.pack.add({ { src = gh("L3MON4D3/LuaSnip"), version = vim.version.range("2.*") } })
|
|
require("luasnip").setup({})
|
|
|
|
vim.pack.add({ gh("rafamadriz/friendly-snippets") })
|
|
require("luasnip.loaders.from_vscode").lazy_load()
|
|
|
|
-- [[ Autocomplete Engine ]]
|
|
vim.pack.add({ { src = gh("saghen/blink.cmp"), version = vim.version.range("1.*") } })
|
|
require("blink.cmp").setup({
|
|
keymap = {
|
|
preset = "default",
|
|
},
|
|
|
|
appearance = {
|
|
nerd_font_variant = "mono",
|
|
},
|
|
|
|
completion = {
|
|
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
|
},
|
|
|
|
sources = {
|
|
default = { "lsp", "path", "snippets" },
|
|
},
|
|
|
|
snippets = { preset = "luasnip" },
|
|
fuzzy = { implementation = "prefer_rust_with_warning" },
|
|
|
|
signature = { enabled = true },
|
|
})
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 9: TREESITTER
|
|
-- Parser installation, syntax highlighting, folds, indentation
|
|
-- ============================================================
|
|
do
|
|
vim.pack.add({ { src = gh("nvim-treesitter/nvim-treesitter"), version = "main" } })
|
|
|
|
local parsers =
|
|
{ "bash", "c", "diff", "html", "lua", "luadoc", "markdown", "markdown_inline", "query", "vim", "vimdoc" }
|
|
require("nvim-treesitter").install(parsers)
|
|
|
|
---@param buf integer
|
|
---@param language string
|
|
local function treesitter_try_attach(buf, language)
|
|
if not vim.treesitter.language.add(language) then
|
|
return
|
|
end
|
|
vim.treesitter.start(buf, language)
|
|
local has_indent_query = vim.treesitter.query.get(language, "indents") ~= nil
|
|
if has_indent_query then
|
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
|
end
|
|
end
|
|
|
|
local available_parsers = require("nvim-treesitter").get_available()
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
callback = function(args)
|
|
local buf, filetype = args.buf, args.match
|
|
|
|
local language = vim.treesitter.language.get_lang(filetype)
|
|
if not language then
|
|
return
|
|
end
|
|
|
|
local installed_parsers = require("nvim-treesitter").get_installed("parsers")
|
|
|
|
if vim.tbl_contains(installed_parsers, language) then
|
|
treesitter_try_attach(buf, language)
|
|
elseif vim.tbl_contains(available_parsers, language) then
|
|
require("nvim-treesitter").install(language):await(function()
|
|
treesitter_try_attach(buf, language)
|
|
end)
|
|
else
|
|
treesitter_try_attach(buf, language)
|
|
end
|
|
end,
|
|
})
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 10: GO
|
|
-- go.nvim setup with guihua.lua dependency
|
|
-- ============================================================
|
|
do
|
|
vim.pack.add({
|
|
gh("ray-x/guihua.lua"),
|
|
gh("ray-x/go.nvim"),
|
|
})
|
|
|
|
require("go").setup({})
|
|
|
|
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", { clear = true })
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
pattern = "*.go",
|
|
callback = function()
|
|
require("go.format").goimports()
|
|
end,
|
|
group = format_sync_grp,
|
|
})
|
|
end
|
|
|
|
-- ============================================================
|
|
-- SECTION 11: ZIG & ZLS (manual config, no Mason)
|
|
-- ============================================================
|
|
do
|
|
-- Install zig.vim plugin
|
|
vim.pack.add({ "https://codeberg.org/ziglang/zig.vim" })
|
|
|
|
-- Disable zig.vim's built-in format-on-save
|
|
vim.g.zig_fmt_parse_errors = 0
|
|
vim.g.zig_fmt_autosave = 0
|
|
|
|
-- Format-on-save using ZLS (matches `zig fmt`)
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
pattern = { "*.zig", "*.zon" },
|
|
callback = function()
|
|
vim.lsp.buf.format()
|
|
end,
|
|
})
|
|
|
|
-- Optional: code actions on save (fixAll + organizeImports)
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
pattern = { "*.zig", "*.zon" },
|
|
callback = function()
|
|
vim.lsp.buf.code_action({
|
|
context = {
|
|
only = { "source.fixAll", "source.organizeImports" },
|
|
},
|
|
apply = true,
|
|
})
|
|
end,
|
|
})
|
|
|
|
---@diagnostic disable-next-line: assign-type-mismatch
|
|
vim.lsp.config["zls"] = {
|
|
cmd = { "zls" },
|
|
filetypes = { "zig" },
|
|
root_markers = { "build.zig" },
|
|
settings = {
|
|
zls = {
|
|
-- omit zig_exe_path if `zig` is on PATH
|
|
-- zig_exe_path = "/path/to/zig",
|
|
},
|
|
},
|
|
}
|
|
|
|
vim.lsp.enable("zls")
|
|
end
|
|
-- vim: ts=2 sts=2 sw=2 et
|