Giter Site home page Giter Site logo

Comments (4)

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 2

Seems as of now, 's' map does not work as it mentioned from nvim-cmp

		['<Tab>'] = cmp.mapping(function(fallback)
			...
		end, { "i", "s"}),

you can check like:

:verbose imap <tab>

it has the mapping, but

:verbose smap <tab>

it doesn't have any mapping. (actually, it had the mapping on the first time but I have no idea why the mapping was cleaned up)

For now, you can use as a workaround

snoremap <Tab> <ESC>:call UltiSnips#JumpForwards()<CR>

I will raise this issue with nvim-cmp author

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Thanks for reporting,

I tried to create separate mapping
snoremap <tab> "<C-R>=UltiSnips#JumpForwards()<CR>"
but then using tab on $2 will create double-quote character for no reason (not sure why)

it should be, then it works

snoremap <Tab> <ESC>:call UltiSnips#JumpForwards()<CR>

I'm investigating why it doesn't work by the current mapping ...

from cmp-nvim-ultisnips.

JoseConseco avatar JoseConseco commented on August 16, 2024

Ok I found the the issue thanks to you and nvim-cmp author (no need to contact him, as this was UltiSnip problem). I will paste the fix here for other people:

we have to use :
vim.fn.feedkeys(t("<esc>:call UltiSnips#JumpForwards()<CR>"))
For tab jumping to work in both insert and select mode (even though UltiSnip is using two separate mappings - not sure why, but single line above works in nivm-cmp for both modes)

Tab still wont work, but in file linked above I found variable UltiSnipsRemoveSelectModeMappings and bingo - UltiSnip was auto-removing tab mappings. We can disable this in Packer config:

		use {'SirVer/ultisnips', requires='honza/vim-snippets',
			config=function()  vim.g.UltiSnipsRemoveSelectModeMappings = 0  end,}

Now tab mapping is not removed by UltiSnips, and we can jump in both insert and select mode

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Hey, thanks, that was a good finding. I will update README for this.

from cmp-nvim-ultisnips.

Related Issues (20)

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.