Using packer.nvim
use 'cyn1x/outhouse.nvim'
Using lazy.nvim
'outhouse.nvim'
Call handler.subprocess()
to run an external program.
require('outhouse').setup{
disabled = false,
auto_start = false,
vertical = true,
}
local handler = require('outhouse.handler')
vim.keymap.set("n", "<leader><leader>x", function()
if vim.fn.has("win32") == 1 then
handler.subprocess(vim.g.win32_build_filename)
elseif vim.fn.has("unix") == 1 then
handler.subprocess(vim.g.unix_build_filename)
else
error("Platform not supported", 2)
end
end)
The example above assumes that the project root directory where nvim
was started in contains an .init.lua
file with global variables denoting the path of their corresponding build scripts. If the global variables do not exist or their paths are invalid, the program will prompt for a file path.
Pull requests are welcome.