From 7c4f361f282f0b68ec6a84da01e08aafdf479741 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 5 Sep 2023 07:34:17 +0100 Subject: [PATCH] feat(nvim): re-add projectionist.vim Re-add `projectionist.vim` with a minimal configuration for setting the alternate file in basic PHP library or TypeScript projects. --- after/plugin/projectionist.lua | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 after/plugin/projectionist.lua diff --git a/after/plugin/projectionist.lua b/after/plugin/projectionist.lua new file mode 100644 index 0000000..681cf4b --- /dev/null +++ b/after/plugin/projectionist.lua @@ -0,0 +1,42 @@ +vim.g.projectionist_heuristics = { + ["composer.json"] = { + ["src/*.php"] = { + type = "source", + alternate = "tests/{}Test.php", + }, + + ["src/Controller/*.php"] = { + type = "controller", + }, + + ["src/Model/*.php"] = { + type = "model", + }, + + ["src/Service/*.php"] = { + type = "service", + }, + + ["tests/*Test.php"] = { + type = "test", + alternate = "src/{}.php", + }, + }, + + ["package.json"] = { + ["src/*.ts"] = { + type = "source", + alternate = "tests/{}.test.ts", + }, + + ["src/*.service.ts"] = { + type = "source", + alternate = "tests/{}.test.ts", + }, + + ["tests/*.test.ts"] = { + type = "test", + alternate = "src/{}.ts", + }, + }, +}