aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorsiduck <siduck@tutanota.com>2022-05-13 16:03:13 +0530
committersiduck <siduck@tutanota.com>2022-05-13 16:03:13 +0530
commit9da534148d8b533637ccea94ad0510ea41770acb (patch)
tree794b14860e8a8f65914cf700cfa024b5605b95cb /README.md
parentnew api for getting terminals (diff)
avoid mapping by default
fix https://github.com/NvChad/NvChad/issues/1071
Diffstat (limited to 'README.md')
-rw-r--r--README.md58
1 files changed, 27 insertions, 31 deletions
diff --git a/README.md b/README.md
index dd06473..5a13c6e 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,10 @@
-# NvChad Official Terminal Plugin
+# NvChad terminal Plugin
-## Setup
+## Install
-### Installation
+- Simply install the plugin with packer as you would for any other:
-Simply install the plugin with packer as you would for any other:
-
-```
+```lua
use {
"NvChad/nvterm",
config = function ()
@@ -16,8 +14,9 @@ use {
```
### Configuration
-Pass a table of configuration options to the plugin's `.setup()` function above.
-A sample configuration table with the default options is shown below:
+
+- Pass a table of configuration options to the plugin's `.setup()` function above.
+- Default configuration table
```lua
require("nvterm").setup({
@@ -40,26 +39,9 @@ require("nvterm").setup({
close_on_exit = true,
auto_insert = true,
},
- mappings = {
- toggle = {
- float = "<A-i>",
- horizontal = "<A-h>",
- vertical = "<A-v>",
- },
- new = {
- horizontal = "<C-h>",
- vertical = "<C-v>",
- },
- },
- enable_new_mappings = false,
})
```
-```
-By default, the mappings for creating a new terminal rather than toggling the current one are disabled.
-If `enable_new_mappings` is set to true, `new` will be set to any mappings passed in the configuration table under `new` or the defaults.
-```
-A shortcut is available for setting options of the different terminal types and mappings:
```lua
require("nvterm").setup({
float = {
@@ -72,11 +54,6 @@ require("nvterm").setup({
},
horizontal = { location = "rightbelow", split_ratio = .3, },
vertical = { location = "rightbelow", split_ratio = .5 },
- mappings{
- toggle {
- horizontal = "<A-s>"
- }
- }
})
```
@@ -104,9 +81,29 @@ require("nvterm").setup({
})
```
+### Functions
+
+Use the below functions to map them for keybindings
+
+#### Toggle
+
+```lua
+require("nvterm.terminal").toggle "float"
+require("nvterm.terminal").toggle "horizontal"
+require("nvterm.terminal").toggle "vertical"
+```
+
+#### Spawn new terminals
+
+```lua
+require("nvterm.terminal").new "horizontal"
+require("nvterm.terminal").new "vertical"
+```
+
### Additional Functionality
NvTerm provides an api for you to send commands to the terminal. You can create different ones for different filetypes like so:
+
```lua
require("nvterm").setup()
@@ -131,4 +128,3 @@ end
`terminal.send` also takes a 'type' parameter, so you can choose what type of terminal to send the command to.
By default, it runs the command in the last opened terminal, or a vertical one if none exist.
`terminal.send(ft_cmds[vim.bo.filetype], "float")` will run the command in a floating terminal
-