Closed Parry-97 closed 1 year ago
nvterm deliberately restores focus after sending the command to the terminal:
A workaround is to use the following:
["<leader>gg"] = {
function()
local term = require("nvterm.terminal").new("float")
vim.api.nvim_chan_send(term.job_id, "lazygit\n")
end,
"open Lazygit",
},
Thanks, @AllanChain .
Hi, I tried using the
send
function for this and the command is successfully executed inside the spawned terminal but I can't insert on that specific terminal and the focus remains on the previously active buffer. have to toggle back to the terminal in order to work on it. Is there another alternative tosend
to execute the command and to work on the terminal in insert mode ?Very simple mapping on my side: