REFACTOR: Annotations for autocompletion, reworked how projects are made

and handled, wrote the c file replacing the copied python code.
This commit is contained in:
2026-10-22 04:29:52 -04:00
parent 3bb97d833b
commit 685a711644
13 changed files with 373 additions and 178 deletions
+58 -31
View File
@@ -1,40 +1,67 @@
return {
c = {
root = "C",
-- source_root = "src/{project_name}",
keybinds = {
["<leader>pr"] = {
desc = "Executes c code",
action = require("vern.actions.c").run,
local M = {}
---@type VernLanguageConfig
M.c = {
root = "C",
dirs = {
src = "src",
include = "include/{project_name}",
},
keybinds = {
["<leader>pr"] = {
desc = "Executes c code",
action = require("vern.actions.c").run,
},
["<leader>pf"] = {
desc = "Creates source/header files",
action = require("vern.actions.c").create_file,
},
},
templates = {
project = {
primary = {
path = "{dirs.src}",
name = "main.c",
kind = "main",
kind_path = "vern.templates.c",
},
["<leader>px"] = {
desc = "Creates header files",
action = require("vern.actions.python").create_header,
manifest = {
path = ".",
name = "CMakeLists.txt",
kind = "CmakeLists",
kind_path = "vern.templates.c",
},
style = {
path = ".",
name = ".clang-format",
kind = "format",
kind_path = "vern.templates.c",
},
},
templates = {
project = {
bin = {
target = "src/{project_name}/main.py",
},
pkg = {
target = "src/{project_name}/__init__.py",
},
cfg = {
target = "pyproject.toml",
},
file = {
header = {
path = "{dirs.include}",
name = "{name}.h",
kind = "header",
kind_path = "vern.templates.c",
},
file = {
mod = {
target = "src/{project_name}/{name}.py",
},
source = {
path = "{dirs.src}",
name = "{name}.c",
kind = "source",
kind_path = "vern.templates.c",
},
extras = {
gitignore = {
template = "vern.templates.extras.gitignore", --- needs to call the function in file
target = ".gitignore",
},
},
extras = {
linter = {
path = ".",
name = ".clang-tidy",
kind = "linter",
kind_path = "vern.templates.c",
enabled = false,
},
},
},
}
return M
+6 -4
View File
@@ -1,4 +1,6 @@
local actions = require("vern.actions")
---@type VernCoreConfig
return {
workspace_root = "~/personal/Projects",
keybinds = {
@@ -13,7 +15,7 @@ return {
},
terminal = {
mode = {
type = "split", --- can be split or float
type = "split",
win = {
float = {
padding = {
@@ -24,12 +26,12 @@ return {
},
border = {
enabled = true,
type = vim.o.winborder,
type = vim.o.winborder, -- defaults to neovim winborder
},
},
split = {
type = "horizontal", --- can be vertical or horizontal
anchor = "bottom", --- can be right or bottom
direction = "horizontal",
anchor = "bottom",
size = "20",
},
},
+10 -12
View File
@@ -1,5 +1,6 @@
local M = {}
---@type VernLanguageConfig
M.python = {
root = "Python",
dirs = {
@@ -10,38 +11,35 @@ M.python = {
desc = "Executes python code",
action = require("vern.actions.python").run,
},
["<leader>pb"] = {
["<leader>pi"] = {
desc = "Asks for what python package to install",
action = require("vern.actions.python").pip_install,
},
},
templates = {
project = {
bin = {
primary = {
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 = {
manifest = {
path = ".",
name = "pyproject.toml",
kind = "pyproject",
kind_path = "vern.templates.python",
},
pkg_init = {
path = "{dirs.src}",
name = "__init__.py",
kind = "__init__",
kind_path = "vern.templates.python",
},
},
file = {
mod = {
path = "{dirs.src}",
-- path = "src/{project_name}",
name = "{name}.py",
kind = "module",
kind_path = "vern.templates.python",