aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiduck <siduck@tutanota.com>2022-10-19 06:12:55 +0530
committersiduck <siduck@tutanota.com>2022-10-19 06:12:55 +0530
commitc5a0b70ebb2342d1d8bbf2b72ec1cae41d84b6e9 (patch)
tree2a816edb99631ce029332f16d2cb05441fd9e714
parentMerge pull request #19 from musjj/patch-1 (diff)
add basic docs for send function
-rw-r--r--README.md14
1 files changed, 14 insertions, 0 deletions
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: