nixvim: add alternate files for *.go and *_test.go
All checks were successful
/ check (push) Successful in 1m45s

This commit is contained in:
Oliver Davies 2025-07-29 22:11:34 +01:00
parent a9b0c5c2b0
commit 7f451136fc

View file

@ -1,5 +1,13 @@
{
flake.modules.nixvim.custom.extraConfigLua = ''
vim.fn["edit_alternate#rule#add"]("go", function(filename)
if filename:find "_test%.go$" then
return filename:gsub("_test%.go$", ".go")
else
return filename:gsub("%.go$", "_test.go")
end
end)
vim.fn["edit_alternate#rule#add"]("php", function(filename)
if filename:find "Test.php$" then
filename = filename:gsub("Test.php$", ".php")