From 0c89202daf32b85f7ed2289b5d11e72f8ff491bd Mon Sep 17 00:00:00 2001 From: dpi0 Date: Thu, 26 Sep 2024 17:50:36 +0530 Subject: [PATCH 1/2] Update README.md with a better presentation --- README.md | 112 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 10959cd..ba8445d 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,45 @@ -# Neoterm +
-Simple neovim terminal plugin written in lua. Terminal runs in a floating window in a configurable position. +

Neoterm.nvim

-Requires `neovim` 0.7+ for access to the lua autocmd API. +

+ Stars + Forks + Contributors + License +

-# Usage +

Simple floating terminal plugin for neovim written in Lua.

-Neoterm provides both vim commands as well as a lua API +
-## Commands -Neoterm provides the following commands +## ⚡ Installation -| Command | Description | -| -------------------- | -------------------------------------------------------------------------------------- | -| `NeotermOpen` | Open the neoterm window | -| `NeotermClose` | Close the neoterm window | -| `NeotermToggle` | Toggle the neoterm window | -| `NeotermRun ` | Run the given command in the neoterm window | -| `NeotermRerun` | Run the previous command again | -| `NeotermExit` | Close the neoterm window and delete the terminal buffer | +Requires `neovim` 0.7+ for access to the Lua Autocmd API. + +[lazy.nvim](https://github.com/folke/lazy.nvim) -## Lua API +```lua +{ + 'itmecho/neoterm.nvim', +} +``` + +[packer.nvim](https://github.com/wbthomason/packer.nvim) + +```lua +use { + 'itmecho/neoterm.nvim', +} +``` + + +## 💡 Usage + +Neoterm provides both vim commands as well as a Lua API. + +### Configuration The following functions are available on the neoterm module. They map directly to the commands above @@ -49,7 +67,33 @@ neoterm.rerun() neoterm.exit() ``` -# Example Keybindings +### Deprecation Notice + +> [!WARNING] +> The `mode` option is deprecated. Please use the new `position` option instead. + +#### Migration Guide + +- `mode = vertical` → `position = right` + +- `mode = horizontal` → `position = bottom` + +- `mode = fullscreen` → `position = fullscreen` + +### Commands + +Neoterm provides the following commands + +| Command | Description | +| -------------------- | -------------------------------------------------------------------------------------- | +| `NeotermOpen` | Open the neoterm window | +| `NeotermClose` | Close the neoterm window | +| `NeotermToggle` | Toggle the neoterm window | +| `NeotermRun ` | Run the given command in the neoterm window | +| `NeotermRerun` | Run the previous command again | +| `NeotermExit` | Close the neoterm window and delete the terminal buffer | + +### Example Vim Keybindings ```vim nnoremap tt NeotermToggle @@ -61,9 +105,9 @@ tnoremap tt NeotermToggle tnoremap tx NeotermExit ``` -# Screenshots +## 🔍 Screenshots -## Right (default) +### `right` ```lua require('neoterm').open() -- or @@ -73,13 +117,13 @@ require('neoterm').open({ position = 2 }) ``` ![position-right](https://github.com/user-attachments/assets/f60ded98-8be4-4dd6-a77b-757ece4f5d84) -## Top +### `top` ```lua require('neoterm').open({ position = 'top', height = 0.6 }) ``` ![position-top](https://github.com/user-attachments/assets/3aba21d5-b0b2-4250-a415-cc478916c90a) -## Bottom +### `bottom` ```lua require('neoterm').open({ position = 'bottom' }) --or @@ -87,19 +131,13 @@ require('neoterm').open({ position = 3 }) ``` ![position-bottom](https://github.com/user-attachments/assets/4c3f557c-44ca-4894-a75d-ef45a3943942) -## Left +### `left` ```lua require('neoterm').open({ position = 'left', width = 0.7 }) ``` ![position-left](https://github.com/user-attachments/assets/812a7d5b-31ed-4061-9bc8-93236b0763f4) -## Center -```lua -require('neoterm').open({ position = 'left', width = 0.6, height = 0.6 }) -``` -![position-center](https://github.com/user-attachments/assets/4cbbf668-c7d4-43ee-a9a6-2e5a6ba3b9fb) - -## Fullscreen +### `fullscreen` ```lua require('neoterm').open({ position = 'fullscreen' }) -- or @@ -107,16 +145,10 @@ require('neoterm').open({ position = 0 }) ``` ![position-fullscreen](https://github.com/user-attachments/assets/9423e593-2c86-48aa-8cba-49024c38e3be) +## Contributors -## Deprecation Notice - -> [!WARNING] -> The `mode` option is deprecated. Please use the new `position` option instead. - -#### Migration Guide - -- `mode = vertical` → `position = right` +Thanks to all contributors! -- `mode = horizontal` → `position = bottom` - -- `mode = fullscreen` → `position = fullscreen` + + + \ No newline at end of file From 295ad31238404b9d09bbb2242219345f4718eb9d Mon Sep 17 00:00:00 2001 From: dpi0 Date: Thu, 26 Sep 2024 17:51:14 +0530 Subject: [PATCH 2/2] Update README.md with improved screenshots --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ba8445d..ca78096 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@

Simple floating terminal plugin for neovim written in Lua.

+![title](https://github.com/user-attachments/assets/00d9942a-d650-42a3-b81e-cc9ba69fa11d) + @@ -115,13 +117,15 @@ require('neoterm').open({ position = 'right' }) -- or require('neoterm').open({ position = 2 }) ``` -![position-right](https://github.com/user-attachments/assets/f60ded98-8be4-4dd6-a77b-757ece4f5d84) + +![position-right](https://github.com/user-attachments/assets/edcb4bcd-12a7-40b7-b95d-7658c835f69c) ### `top` ```lua require('neoterm').open({ position = 'top', height = 0.6 }) ``` -![position-top](https://github.com/user-attachments/assets/3aba21d5-b0b2-4250-a415-cc478916c90a) + +![position-top](https://github.com/user-attachments/assets/18a984a2-4ea5-4f9c-a123-4631ac25bcb2) ### `bottom` ```lua @@ -129,21 +133,17 @@ require('neoterm').open({ position = 'bottom' }) --or require('neoterm').open({ position = 3 }) ``` -![position-bottom](https://github.com/user-attachments/assets/4c3f557c-44ca-4894-a75d-ef45a3943942) -### `left` -```lua -require('neoterm').open({ position = 'left', width = 0.7 }) -``` -![position-left](https://github.com/user-attachments/assets/812a7d5b-31ed-4061-9bc8-93236b0763f4) +![position-bottom](https://github.com/user-attachments/assets/9a40db31-22b2-4e6d-9213-744e0de73498) -### `fullscreen` + +### `left` ```lua -require('neoterm').open({ position = 'fullscreen' }) +require('neoterm').open({ position = 'left', width = 0.3 }) -- or -require('neoterm').open({ position = 0 }) +require('neoterm').open({ position = 4 }) ``` -![position-fullscreen](https://github.com/user-attachments/assets/9423e593-2c86-48aa-8cba-49024c38e3be) +![position-left](https://github.com/user-attachments/assets/9d0de2ad-af8d-4c3f-a4a8-908dc907aa14) ## Contributors