-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrecipes.lua.example
More file actions
42 lines (36 loc) · 1.18 KB
/
recipes.lua.example
File metadata and controls
42 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- Example recipes.lua file for cook.nvim
-- Place this file in your project root to define custom tasks
--
-- Placeholders available:
-- {file} - Full file path
-- {filename} - Filename with extension
-- {name} - Filename without extension
-- {dir} - Directory path
-- {ext} - File extension
-- {exe} - Full executable path (dir + name)
return {
recipes = {
-- Simple project-wide commands
dev = "npm run dev",
build = "npm run build",
test = "npm test",
lint = "npm run lint",
format = "npm run format",
-- File-specific commands using placeholders
compile = "gcc {file} -o {exe} -Wall",
run = "{exe}",
compile_and_run = "gcc {file} -o {exe} && {exe}",
-- Advanced examples
debug = "gcc -g {file} -o {exe} && gdb {exe}",
valgrind = "gcc -g {file} -o {exe} && valgrind {exe}",
profile = "gcc -pg {file} -o {exe} && {exe} && gprof {exe}",
-- Combine placeholders creatively
backup = "cp {file} {file}.bak",
archive = "tar -czf {name}.tar.gz {file}",
-- Integration with Vim commands (prefix with !)
cmake_build = "!CMakeBuild",
cmake_run = "!CMakeRun",
-- Legacy %s syntax also supported
-- old_style = "python3 %s",
},
}