mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 12:51:45 +00:00
add modular template configs for golang
This commit is contained in:
parent
ec5d98732b
commit
d68ee3ab03
@ -2,9 +2,15 @@ return {
|
|||||||
-- Simple task runner plugin
|
-- Simple task runner plugin
|
||||||
'stevearc/overseer.nvim',
|
'stevearc/overseer.nvim',
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function(_, opts)
|
config = function()
|
||||||
local overseer = require 'overseer'
|
local overseer = require 'overseer'
|
||||||
overseer.setup(opts or {})
|
overseer.setup {
|
||||||
|
templates = {
|
||||||
|
'builtin',
|
||||||
|
'golang.run_project',
|
||||||
|
'golang.run_file',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- Display status info about tasks
|
-- Display status info about tasks
|
||||||
vim.keymap.set('n', '<leader>ol', function()
|
vim.keymap.set('n', '<leader>ol', function()
|
||||||
|
10
lua/overseer/template/golang/run_file.lua
Normal file
10
lua/overseer/template/golang/run_file.lua
Normal 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' },
|
||||||
|
}
|
10
lua/overseer/template/golang/run_project.lua
Normal file
10
lua/overseer/template/golang/run_project.lua
Normal 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' },
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user