nixvim: add alternate files for *.go and *_test.go
All checks were successful
/ check (push) Successful in 1m45s
All checks were successful
/ check (push) Successful in 1m45s
This commit is contained in:
parent
a9b0c5c2b0
commit
7f451136fc
1 changed files with 8 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue