diff options
Diffstat (limited to '.config/nvim/lua/overseer/template/custom')
| -rw-r--r-- | .config/nvim/lua/overseer/template/custom/init.lua | 3 | ||||
| -rw-r--r-- | .config/nvim/lua/overseer/template/custom/make_c.lua | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/.config/nvim/lua/overseer/template/custom/init.lua b/.config/nvim/lua/overseer/template/custom/init.lua new file mode 100644 index 0000000..be9e689 --- /dev/null +++ b/.config/nvim/lua/overseer/template/custom/init.lua @@ -0,0 +1,3 @@ +return { + 'custom.make_c', +} diff --git a/.config/nvim/lua/overseer/template/custom/make_c.lua b/.config/nvim/lua/overseer/template/custom/make_c.lua new file mode 100644 index 0000000..358047f --- /dev/null +++ b/.config/nvim/lua/overseer/template/custom/make_c.lua @@ -0,0 +1,20 @@ +local overseer = require('overseer') +return { + name = 'Make Current C file', + builder = function(_) + local path = vim.fn.expand('%:p') + local dir, file = path:gmatch('(.*)[/\\](.*)')() + file = string.sub(file, 1, -3) -- remove .c extension + + return { + cmd = { 'make' }, + args = { file }, + cwd = dir, + } + end, + tags = { overseer.TAG.BUILD }, + priority = 20, + condition = { + filetype = { 'c' }, + }, +} |
