An open API service indexing awesome lists of open source software.

https://github.com/iquzart/toggleword.nvim

Smart word toggling under the cursor for Neovim
https://github.com/iquzart/toggleword.nvim

lazyvim neovim neovim-plugin packer toggle toggleword

Last synced: 26 days ago
JSON representation

Smart word toggling under the cursor for Neovim

Awesome Lists containing this project

README

          


toggleword.nvim


A minimal Neovim plugin to toggle boolean-like words under your cursor.





## Features

- Toggle common values like `true` ⇄ `false`, `on` ⇄ `off`, etc.
- Minimal, fast, and Lua-native.
- Configurable keybinding.
- Custom toggle pairs supported.

## Installation

### Lazy.nvim:

```lua
{
"iquzart/toggleword.nvim",
opts = {
key = "tt" -- optional, defaults to tt,
}
}
```

### packer.nvim:

```lua
use {
"yourname/toggleword.nvim",
config = function()
require("toggleword").setup()
end,
}
```

### Supported words

```
- true ⇄ false
- on ⇄ off
- enabled ⇄ disabled
- yes ⇄ no
- up ⇄ down
- start ⇄ stop
- open ⇄ close
- allow ⇄ deny
- accept ⇄ reject
- read ⇄ write
- push ⇄ pull
- inbound ⇄ outbound
- public ⇄ private
- online ⇄ offline
- local ⇄ remote
- master ⇄ slave
- primary ⇄ replica
- active ⇄ passive
- manual ⇄ automatic

- prod ⇄ uat ⇄ dev ⇄ preprod (cyclical)
```

### Custom Toggle Pairs

You can override the default list:

```lua
require("toggleword").setup {
key = "tw",
toggle_groups = {
{"start", "stop"},
{"open", "close"},
{"active", "inactive"},
}
}
```

### Usage

```
Place your cursor on a supported word and press tt.
If the word matches a toggle pair, it will be replaced with the opposite.
```