From 637d8e143bfe5b3aa9a258a2e0f733a582a98925 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 12 Jul 2024 16:51:16 +0300 Subject: Neovim: configured overseer (task runner), added a make_c task template --- .config/nvim/lua/overseer/template/custom/init.lua | 3 +++ .config/nvim/lua/overseer/template/custom/make_c.lua | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .config/nvim/lua/overseer/template/custom/init.lua create mode 100644 .config/nvim/lua/overseer/template/custom/make_c.lua (limited to '.config/nvim/lua/overseer/template/custom') 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' }, + }, +} -- cgit v1.3.1