This Neovim plugin provides mappings and textobj for indentations capable of
repeating jumps with ;
and ,
;
Jumping along the indents ([i
, ]i
):
Text object (dii
, cai
, yii
, vai
, etc.):
This library supports Neovim v0.7.0 or newer.
This plugin depends are the following libraries. Please make sure to add them as dependencies in your package manager:
- arshlib.nvim
- (Optional) nvim-treesitter-textobjects
The nvim-treesitter-textobjects is only used for repeatable jumps.
Use your favourite package manager to install this library.
{
"arsham/indent-tools.nvim",
dependencies = {
"arsham/arshlib.nvim",
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = true,
-- or to provide configuration
-- config = { normal = {..}, textobj = {..}},
}
use({
"arsham/indent-tools.nvim",
requires = {
"arsham/arshlib.nvim",
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require("indent-tools").config({})
end,
})
By default this pluging adds all necessary mappings. However you can change or disable them to your liking.
To disable set them to false
. For example:
require("indent-tools").config({
textobj = false,
})
Here is the default settings:
{
normal = {
up = "[i",
down = "]i",
repeatable = true, -- requires nvim-treesitter-textobjects
},
textobj = {
ii = "ii",
ai = "ai",
},
}
If repeatable is set to true and nvim-treesitter-textobjects plugin is
installed, you can repeat the jumps back and forth with ;
and ,
.
You can let your package manager to load this plugin when a key-mapping event is fired.
use({
"arsham/indent-tools.nvim",
requires = { "arsham/arshlib.nvim" },
config = function()
require("indent-tools").config({})
end,
keys = { "]i", "[i", { "v", "ii" }, { "o", "ii" } },
})
{
"arsham/indent-tools.nvim",
dependencies = {
"arsham/arshlib.nvim",
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = true,
keys = { "]i", "[i", { "v", "ii" }, { "o", "ii" } },
}
Licensed under the MIT License. Check the LICENSE file for details.