diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index d60c5bc..34131ce 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -2,9 +2,15 @@ return { -- Simple task runner plugin 'stevearc/overseer.nvim', opts = {}, - config = function(_, opts) + config = function() local overseer = require 'overseer' - overseer.setup(opts or {}) + overseer.setup { + templates = { + 'builtin', + 'golang.run_project', + 'golang.run_file', + }, + } -- Display status info about tasks vim.keymap.set('n', 'ol', function() diff --git a/lua/overseer/template/golang/run_file.lua b/lua/overseer/template/golang/run_file.lua new file mode 100644 index 0000000..777c7c2 --- /dev/null +++ b/lua/overseer/template/golang/run_file.lua @@ -0,0 +1,10 @@ +-- Run currently open go file using Overseer +return { + name = 'go run file', + builder = function(_) + return { + cmd = 'go run ${file}', + } + end, + condition = { filetype = 'go' }, +} diff --git a/lua/overseer/template/golang/run_project.lua b/lua/overseer/template/golang/run_project.lua new file mode 100644 index 0000000..8a2d0fc --- /dev/null +++ b/lua/overseer/template/golang/run_project.lua @@ -0,0 +1,10 @@ +-- Run project in working directory using Overseer +return { + name = 'go run', + builder = function(_) + return { + cmd = 'go run .', + } + end, + condition = { filetype = 'go' }, +}