You have that one command for building or running your project and want to have a keymap set, but you don't want to change your Neovim config or worry about different keymaps for different projects.
With Quick Run you set the command to run, then use the predefined keymap (default <F5>) to run it whenever you want.
Using lazy.nvim:
{ 'LiamFenneman/quick-run.nvim', opts = {} },
Using packer:
use 'LiamFenneman/quick-run.nvim'
require('quick-run').setup({})
require('quick-run').setup({
default_cmd = 'echo "Hello World"',
mappings = {
quick_run = '<F5>',
},
callbacks = {
on_stdout = function(_, data, _)
vim.api.nvim_out_write(table.concat(data, '\n'))
end,
on_stderr = function(_, data, _)
vim.api.nvim_err_write(table.concat(data, '\n'))
end,
on_exit = function(_, data, _) end,
},
})