kawre / neotab.nvim Goto Github PK
View Code? Open in Web Editor NEWTabout plugin for Neovim
Tabout plugin for Neovim
Hi @kawre, thanks for the great work on this plugin! Unfortunately, I'm having trouble making it compatible with vim-vsnip. My initial approach was to adapt the lua logic presented for luasnip
, but that didn't quite work. Any attempt to use the tab_handler function was met with nil value
errors.
I've tried this mapping instead, relying on a fallback function:
vim.api.nvim_set_keymap(
'i', '<Tab>',
"vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Plug>(neotab-out)'",
{expr = true, silent = true}
)
Instead of the plugin function, though, it prints a literal string of <Plug>(neotab-out)
.
Is there anything on my end I can change in the config to make it work? I'd love to start using this plugin.
Any help is greatly appreciated ๐
Hi, trying to setup neotab i see that using Tab pops a menu with two options: Goto Definition and References.
Checking with :verbose imap <Tab>
results in:
i <Tab> * <Lua 1351: ~/.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/keymap.lua:127>
cmp.utils.keymap.set_map
Last set from Lua
I set tabkey to ""
in neotab config and nvim-cmp config this way:
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
--fallback()
require("neotab").tabout()
else
--fallback()
require("neotab").tabout()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
require("neotab").tabout()
--fallback()
end
end,
Advices on how this can be fixed?
Thanks!
Unfortunately, when adding this to the config for native snippets which uses tab to go to the next jump in the snippet, it breaks.
I'm not sure if there's an easy way to fix this.
What I've tried:
keys = {
{
"<Tab>",
function()
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Plug>neotab-out"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
},
cannot tab backward using <S-Tab>
Idea is to use neotab.nvim
for non-treesitter buffers, and tabout.nvim
for treesitter buffers, by assigning a function to the single tab key.
I wonder if and how this could be implemented using the LazyVim distribution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.