/NeoSwap.nvim

Neovim plugin that simplifies word swapping, making it easy to rearrange words in your code.

Primary LanguageLuaMIT LicenseMIT

🔄 NeoSwap.nvim

Lua Neovim

demo

📢 Introduction

NeoSwap simplifies word swapping in Neovim, making it easy to quickly rearrange words within your code.

Features

  • Swap words with ease in Neovim using NeoSwap's built-in pattern matching.
  • Streamline your coding workflow with efficient word swapping.

🛠️ Usage

To swap the position of adjacent words to the right of the cursor, use the NeoSwapNext command:

:NeoSwapNext

To swap the position of adjacent words to the left of the cursor, use the NeoSwapNext command:

:NeoSwapPrev

You can also create keybindings to swap words more conveniently:

vim.keymap.set("n", "<leader>s", "<cmd>NeoSwapNext<cr>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader>S", "<cmd>NeoSwapPrev<cr>", { noremap = true, silent = true })

📦 Installation

  1. Install via your favorite package manager.
{
  "ecthelionvi/NeoSwap.nvim",
  opts = {}
},
use "ecthelionvi/NeoSwap.nvim"
  1. Setup the plugin in your init.lua. This step is not needed with lazy.nvim if opts is set as above.
require("NeoSwap").setup()

🙏 Acknowledgments

Special thanks to LostNeophyte for their contributions to the development of NeoSwap. Your help is greatly appreciated!