Skip to content

Instantly share code, notes, and snippets.

@bevancollins
Last active December 15, 2024 22:16
Show Gist options
  • Save bevancollins/9bd04deb6ca14ccd75fee8652fcb7ad8 to your computer and use it in GitHub Desktop.
Save bevancollins/9bd04deb6ca14ccd75fee8652fcb7ad8 to your computer and use it in GitHub Desktop.
Execute invoke tasks (https://www.pyinvoke.org/) from neovim
vim.api.nvim_create_user_command(
'Inv',
function(opts)
vim.cmd('new')
vim.cmd('term inv ' .. opts.args)
vim.cmd('startinsert')
end,
{
nargs = "*", -- Allow optional arguments
desc = "Run 'inv' with the specified arguments in a new terminal",
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment