supertab.nvim is a neovim plugin for overloading keys with multiple actions. It aims to be easily configurable to avoid the headache of conflicting mappings and configuring supertab functionality manually.
- Overloading mappings for multiple actions on arbitrary keys.
- Sane default configuration with support for
luasnip,supermaven, and more! - Light weight
Install with your preferred plugin manager. Here's an example for lazy.nvim:
return {
"hisbaan/supertab.nvim",
dependencies = {
-- optional dependencies for the default configuration
"L3MON4D3/LuaSnip",
"supermaven-inc/supermaven-nvim"
},
keys = {
-- mapping for the default configuration
{ "<Tab>", function() require("supertab").trigger("<Tab>") end, mode = "i", desc = "Supertab" }
},
--- @module 'supertab'
--- @type supertab.Config
opts = {}
}The following is an example of my personal configuration:
return {
"hisbaan/supertab.nvim",
dependencies = {
"L3MON4D3/LuaSnip",
"supermaven-inc/supermaven-nvim"
},
lazy = false,
keys = {
{ "<Tab>", function() require("supertab").trigger("<Tab>") end, mode = "i", desc = "Supertab" }
},
--- @module 'supertab'
--- @type fun():supertab.Config
opts = function()
local luasnip = require('luasnip')
local supermaven = require('supermaven-nvim.completion_preview')
return {
keys = {
['<Tab>'] = {
{
condition = function()
return luasnip.expand_or_jumpable()
end,
action = function()
luasnip.expand_or_jump()
end
},
{
condition = function()
return supermaven.has_suggestion()
end,
action = function()
supermaven.on_accept_suggestion()
end,
}
}
}
}
end
}