-- AniTrack project-local Neovim config (for LazyVim users) -- Requires: vim.o.exrc = true in your Neovim config; approve the :trust prompt. local here = vim.fs.dirname(debug.getinfo(1, "S").source:sub(2)) -- project-local treesitter queries (graphql injections for Go raw strings) vim.opt.rtp:append(here .. "/.nvim") vim.api.nvim_create_autocmd("FileType", { pattern = "go", once = true, callback = function() -- ensure the graphql treesitter parser exists (no-op when already installed) pcall(function() local LazyVim = require("lazyvim.util") if not LazyVim.treesitter.have("graphql") then require("nvim-treesitter").install({ "graphql" }) end end) -- conform: format embedded graphql regions via prettier (injected formatter) require("conform").setup({ formatters_by_ft = { go = { "goimports", "gofumpt", "injected" }, graphql = { "prettier" }, }, formatters = { prettier = { -- conform's injected formatter resolves formatters against the host -- (go) buffer, so LazyVim's filetype-gated prettier condition would -- filter it out; safe to relax since prettier is only registered -- for filetypes it supports. condition = function() return true end, }, }, }) end, })