An enhanced <C-a> and <C-x> plugin for Neovim that allows toggling between predefined keyword groups in addition to the default numeric increment/decrement behavior.
- Works like
<C-a>and<C-x>, but supports custom keyword groups. - Supports language-specific groups (e.g.,
==↔~=in Lua,let↔varin Swift). - Customizable via
setup().
Use your favorite plugin manager:
{
"Ipomoea/increment.nvim",
config = function()
require("increment").setup()
end
}use {
"Ipomoea/increment.nvim",
config = function()
require("increment").setup()
end
}Plug 'Ipomoea/increment.nvim'Then, in your Lua config:
require("increment").setup()Call require("increment").setup() with an optional configuration table:
require("increment").setup({
groups = {
{ "+", "-" },
{ "==", "!=" },
{ "true", "false" },
{ "YES", "NO" },
{ "&&", "||" },
},
lang_groups = {
lua = {
{ "==", "~=" },
},
swift = {
{ "let", "var" },
},
}
})- Place the cursor over a word from a defined group and press
<C-a>to cycle forward or<C-x>to cycle backward. - Works with language-specific groups if defined.
This project is licensed under the MIT License. See the LICENSE file for details.
Inspired by the default behavior of <C-a> and <C-x> in Neovim and extended for additional keyword toggling.