Git Product home page Git Product logo

neotab.nvim's People

Contributors

kawre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

neotab.nvim's Issues

Vsnip compatibility

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 ๐Ÿ˜„

<Tab> already mapped by ~/.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/keymap.lua:127

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!

Native Snippet support

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" },
  },
},

Idea: use both `neotab.nvim` and `tabout.nvim`

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.