Skip to content

[question] How to disable TAB and S-TAB? #1373

@jabbalaci

Description

@jabbalaci

I have a snippet like this:

snippet for
	for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
		${4}
	}

After inserting a snippet, in insert mode I use TAB to insert 4 spaces. However, TAB means jump in LuaSnip. I added jumps to different hotkeys. Here is my config:

return {
  'L3MON4D3/LuaSnip',
  lazy = true,
  config = function()
    require('luasnip').setup {
      -- Your luasnip config here
    }
    -- for snipmate format:
    require('luasnip.loaders.from_snipmate').lazy_load()
  end,
  keys = {
    {
      '<C-h>',
      function()
        require('luasnip').jump(-1)
      end,
      mode = { 'i', 's' },
    },
    {
      '<C-l>',
      function()
        require('luasnip').jump(1)
      end,
      mode = { 'i', 's' },
    },
  },
}

But it leaves TAB and S-TAB still activated. I don't need them. How could I disable them completely? C-h and C-l are enough for me, and then I could use TAB in insert mode for indenting. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions