add modular template configs for golang

This commit is contained in:
Baipyrus 2024-06-05 13:07:31 +02:00
parent ec5d98732b
commit d68ee3ab03
3 changed files with 28 additions and 2 deletions

View File

@ -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', '<leader>ol', function()

View File

@ -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' },
}

View File

@ -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' },
}