Oliver Davies
8f9401594b
Whilst I wasn't able to get it to work for all my use cases previously, it is useful for creating alternative files in Fractal, such as switching between the `*.config.yml` and `*.twig` files for a component. Other use cases, such as creating alternative files for classes and tests in PHP and Drupal projects, I can look at again now the plugin is installed.
58 lines
1 KiB
Lua
58 lines
1 KiB
Lua
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",
|
|
},
|
|
},
|
|
|
|
["fractal.config.js"] = {
|
|
["*.config.yml"] = {
|
|
type = "config",
|
|
alternate = "{dirname}/{basename}.twig",
|
|
},
|
|
|
|
["*.twig"] = {
|
|
type = "template",
|
|
alternate = "{dirname}/{basename}.config.yml",
|
|
},
|
|
},
|
|
|
|
["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",
|
|
},
|
|
},
|
|
}
|
|
|
|
-- Switch to an alternative file.
|
|
vim.keymap.set("n", "<leader>aa", "<cmd>A<cr>")
|