From c4bfaacbe541118bf437b497f7b9aaa4f0eecf7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 1 Dec 2021 13:28:50 +0100 Subject: [PATCH] Add kotlin projectionist config --- symlinks/config/nvim/plugin/projectionist.lua | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/symlinks/config/nvim/plugin/projectionist.lua b/symlinks/config/nvim/plugin/projectionist.lua index e5b2def..6b3dd31 100644 --- a/symlinks/config/nvim/plugin/projectionist.lua +++ b/symlinks/config/nvim/plugin/projectionist.lua @@ -324,6 +324,55 @@ local java_project_config = { }, } +local kotlin_project_config = { + ["src/main/kotlin/*.kt"] = { + type = "source", + template = { + "package {dirname|dot}", + "", + "class {basename} {open}", + "{close}" + }, + alternate = "src/test/kotlin/{}Test.kt" + }, + ["src/main/java/*.kt"] = { + type = "source", + template = { + "package {dirname|dot}", + "", + "class {basename} {open}", + "{close}" + }, + alternate = "src/test/java/{}Test.kt" + }, + ["src/test/kotlin/*Test.kt"] = { + type = "test", + template = { + "package {dirname|dot}", + "", + "class {basename}Test {open}", + "{close}" + }, + alternate = "src/main/kotlin/{}.kt" + }, + ["src/test/java/*Test.kt"] = { + type = "test", + template = { + "package {dirname|dot}", + "", + "class {basename}Test {open}", + "{close}" + }, + alternate = "src/main/java/{}.kt" + }, + ["src/main/resources/*"] = { + type = "resource" + }, + ["src/test/resources/*"] = { + type = "testresource" + } +} + local mint_config = { ["*"] = { start = "mint start" @@ -426,6 +475,7 @@ vim.g.projectionist_heuristics = { ["src/*.c|test/*.c"] = c_project_config("c", "h"), ["lua/"] = lua_vim_plugin_config, ["build.gradle|pom.xml"] = java_project_config, + ["build.gradle|build.gradle.kts"] = kotlin_project_config, ["mint.json"] = mint_config, ["shard.yml"] = crystal_config }