REFACTOR: Completely changed how project creation is done so I can make
other languages easier and hopefully faster
This commit is contained in:
+49
-36
@@ -1,40 +1,53 @@
|
||||
return {
|
||||
python = {
|
||||
root = "Python",
|
||||
source_root = "src/{project_name}",
|
||||
keybinds = {
|
||||
["<leader>pr"] = {
|
||||
desc = "Executes python code",
|
||||
action = require("vern.actions.python").run,
|
||||
},
|
||||
["<leader>pb"] = {
|
||||
desc = "Asks for what python package to install",
|
||||
action = require("vern.actions.python").pip_install,
|
||||
},
|
||||
local M = {}
|
||||
|
||||
M.python = {
|
||||
root = "Python",
|
||||
dirs = {
|
||||
src = "src/{project_name}",
|
||||
},
|
||||
keybinds = {
|
||||
["<leader>pr"] = {
|
||||
desc = "Executes python code",
|
||||
action = require("vern.actions.python").run,
|
||||
},
|
||||
templates = {
|
||||
project = {
|
||||
["bin"] = {
|
||||
target = "src/{project_name}/main.py",
|
||||
},
|
||||
["pkg"] = {
|
||||
target = "src/{project_name}/__init__.py",
|
||||
},
|
||||
["spec"] = {
|
||||
target = "pyproject.toml",
|
||||
},
|
||||
},
|
||||
file = {
|
||||
["module"] = {
|
||||
target = "src/{project_name}/{name}.py",
|
||||
},
|
||||
},
|
||||
extras = {
|
||||
["gitignore"] = {
|
||||
template = "vern.templates.extras.gitignore", --- needs to call the function in file
|
||||
target = ".gitignore",
|
||||
},
|
||||
},
|
||||
["<leader>pb"] = {
|
||||
desc = "Asks for what python package to install",
|
||||
action = require("vern.actions.python").pip_install,
|
||||
},
|
||||
},
|
||||
templates = {
|
||||
project = {
|
||||
bin = {
|
||||
path = "{dirs.src}",
|
||||
-- path = "src/{project_name}",
|
||||
name = "main.py",
|
||||
kind = "main",
|
||||
kind_path = "vern.templates.python",
|
||||
},
|
||||
pkg = {
|
||||
path = "{dirs.src}",
|
||||
-- path = "src/{project_name}",
|
||||
name = "__init__.py",
|
||||
kind = "__init__",
|
||||
kind_path = "vern.templates.python",
|
||||
},
|
||||
cfg = {
|
||||
path = ".",
|
||||
name = "pyproject.toml",
|
||||
kind = "pyproject",
|
||||
kind_path = "vern.templates.python",
|
||||
},
|
||||
},
|
||||
file = {
|
||||
mod = {
|
||||
path = "{dirs.src}",
|
||||
-- path = "src/{project_name}",
|
||||
name = "{name}.py",
|
||||
kind = "module",
|
||||
kind_path = "vern.templates.python",
|
||||
},
|
||||
},
|
||||
extras = {},
|
||||
},
|
||||
}
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user