Closed chmln closed 3 years ago
This feature was also in my mind. But I think I might need to implement multiple terminals instances first as currently It only supports only one terminal instance.
So I found function "chansend()" which can send argument to terminal (https://neovim.io/doc/user/channel.html). I guess it will help you.
As it turns out this was fairly easy to implement, I just need to allow the run command to be customizable. You just need to use the underlying terminal function to make this work. Just switch to the multi
branch to test it out give your initial feedback. If you have anything else on your mind do let me know.
And also sorry for the delay :)
local term = require("FTerm.terminal")
-- Opening bashtop
local bashtop = term:new()
bashtop:setup({cmd = "bashtop"})
function _G.__fterm_bashtop()
bashtop:toggle()
end
-- Opening gitui
local gitui = term:new()
gitui:setup({cmd = "gitui"})
function _G.__fterm_gitui()
gitui:toggle()
end
Just ignore the broken highlights in
gitui
That's good. What about to make symbols (like % in Floaterm) to send file name.
I am not sure about the vim character like %
, $
. But you can use the lua API like vim.api.nvim_get_current_buf()
which I think is same as %
.
It would be great to have the ability to pass a command to a floating terminal. I would use this to launch
lazygit
with a single keybind.