From c5a0b70ebb2342d1d8bbf2b72ec1cae41d84b6e9 Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 19 Oct 2022 06:12:55 +0530 Subject: add basic docs for send function --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 6fe2a55..d9bd44b 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,20 @@ require("nvterm.terminal").new "horizontal" require("nvterm.terminal").new "vertical" ``` +#### Send commands to the terminal + +```lua + require("nvterm.terminal").send(" your command ", "horizontal|vertical|float") -- the 2nd argument i.e direction is optional +``` + +- This function will first open a horizontal terminal and then run the `node test.js` command +- Whenever you re-run this function, it'll just run that command in that horizontal terminal. +```lua +function() + require("nvterm.terminal").send("node test.js", "horizontal") +end, +``` + ### Additional Functionality NvTerm provides an api for you to send commands to the terminal. You can create different ones for different filetypes like so: -- cgit v1.2.3-70-g09d2