diff --git a/README.md b/README.md index 10959cd..ca78096 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,47 @@ -# 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 +![title](https://github.com/user-attachments/assets/00d9942a-d650-42a3-b81e-cc9ba69fa11d) -## 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 | +## ⚡ Installation + +Requires `neovim` 0.7+ for access to the Lua Autocmd API. + +[lazy.nvim](https://github.com/folke/lazy.nvim) + +```lua +{ + 'itmecho/neoterm.nvim', +} +``` -## Lua API +[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 +69,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 +107,9 @@ tnoremap tt NeotermToggle tnoremap tx NeotermExit ``` -# Screenshots +## 🔍 Screenshots -## Right (default) +### `right` ```lua require('neoterm').open() -- or @@ -71,52 +117,38 @@ require('neoterm').open({ position = 'right' }) -- or require('neoterm').open({ position = 2 }) ``` -![position-right](https://github.com/user-attachments/assets/f60ded98-8be4-4dd6-a77b-757ece4f5d84) -## Top +![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) -## Bottom +![position-top](https://github.com/user-attachments/assets/18a984a2-4ea5-4f9c-a123-4631ac25bcb2) + +### `bottom` ```lua 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) -## 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 +### `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) -## Deprecation Notice +## Contributors -> [!WARNING] -> The `mode` option is deprecated. Please use the new `position` option instead. +Thanks to all contributors! -#### Migration Guide - -- `mode = vertical` → `position = right` - -- `mode = horizontal` → `position = bottom` - -- `mode = fullscreen` → `position = fullscreen` + + + \ No newline at end of file