summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/overseer
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-07-12 16:51:16 +0300
committerKyren223 <ulmliad223@gmail.com>2024-07-12 16:51:16 +0300
commit637d8e143bfe5b3aa9a258a2e0f733a582a98925 (patch)
tree99415f58416e94dbec31bcb6942e050d10262f90 /.config/nvim/lua/overseer
parent0652aa92543b458b890ce234c78c02166c45d8f2 (diff)
Neovim: configured overseer (task runner), added a make_c task template
Diffstat (limited to '.config/nvim/lua/overseer')
-rw-r--r--.config/nvim/lua/overseer/template/custom/init.lua3
-rw-r--r--.config/nvim/lua/overseer/template/custom/make_c.lua20
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' },
+ },
+}