This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
opdavies.nvim/after/plugin/projectionist.lua
2023-09-14 19:08:50 +01:00

59 lines
1 KiB
Lua

local 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"] = {
alternate = "{dirname}/{basename}.twig",
},
["*.twig"] = {
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",
},
},
}
vim.g.projectionist_heuristics = heuristics
local nmap = require("opdavies.keymap").nmap
nmap { "<leader>aa", "<cmd>A<cr>" }