kawre / neotab.nvim

Tabout plugin for Neovim
85 stars 0 forks source link

Is it possible to tabout in luasnippet nodes if it is "taboutable" and if not, use luasnippets' tab? #1

Open xzbdmw opened 7 months ago

kawre commented 6 months ago

Sorry for the late response, Merged it, but it feels like in the long term it might be more annoying then useful.

Let me know if this is what you want

To use it, change your luasnip keys to something like this

    {
        "<Tab>",
        function() return "<Plug>(neotab-out-luasnip)" end,
        expr = true,
        silent = true,
        mode = "i",
    },
yifan0414 commented 6 months ago

Sorry for the late response, Merged it, but it feels like in the long term it might be more annoying then useful.

Let me know if this is what you want

To use it, change your luasnip keys to something like this

    {
        "<Tab>",
        function() return "<Plug>(neotab-out-luasnip)" end,
        expr = true,
        silent = true,
        mode = "i",
    },

If I am using nvim-cmp and luasnip, how should I modify my code?

        ["<Tab>"] = cmp.mapping(function()
          if cmp.visible() then
            cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
          elseif luasnip.expand_or_jumpable(1) then
            luasnip.expand_or_jump(1)
          else
            neotab.tabout()
          end
        end, { "i", "s" }),
kawre commented 6 months ago

@yifan0414 this should work

["<Tab>"] = cmp.mapping(function()
          if cmp.visible() then
            cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
          else
            neotab.tabout_luasnip()
          end
        end, { "i", "s" }),