Giter Site home page Giter Site logo

Comments (24)

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 2

neovim nightly is not supposed to be stable. yeah surely it will be hiccup sometimes

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 1

@captainko this is how the guys here hrsh7th/nvim-cmp#241 (comment) fix it

  use {'honza/vim-snippets', rtp = '.'}

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 1

completion = { completeopt = "menu,menuone,noinsert" }, -- removing this has helped the supertab to work

That's weird, this is the setting recommended by cmp author

Can you try with

	["<S-Tab>"] = cmp.mapping(function(fallback)
		if vim.fn["UltiSnips#CanJumpBackwards"]() == 1 then
			return vim.fn.feedkeys(t("<ESC>:call UltiSnips#JumpBackwards()<CR>"))
		elseif vim.fn.pumvisible() == 1 then
			vim.fn.feedkeys(t("<C-p>"), "n")
		else
			fallback()
		end
	end

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 1

you had better ask ultisnips author. IMO Ultisnips is more way friendly, easy to learn, versatile and has rich support from overall languages. Probably comparing to the other snippet engines, it slows, but how much is it?

I have been using ultisnips for 3 years and had no problem with performance, If your laptop is not produced in 1970 then I would say just use it

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024 1

Sure, since the root cause was fixed, we don't need that in the readme

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Thanks, I will check

from cmp-nvim-ultisnips.

rebelot avatar rebelot commented on August 16, 2024

please see hrsh7th/nvim-cmp#241 (comment)

from cmp-nvim-ultisnips.

captainko avatar captainko commented on August 16, 2024

I think we should report this issue at UltiSnippets repo instead. As I notice earlier that my local snippets are still get sourced but not the ones provided by the vim-snippets.

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Just installed neovim nightly and there are many plugins installed on my machine stop working

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Let's see if I could do something from cmp-nvim-ultisnips's side

from cmp-nvim-ultisnips.

captainko avatar captainko commented on August 16, 2024

Oh thanks, It works like charms.

from cmp-nvim-ultisnips.

rebelot avatar rebelot commented on August 16, 2024

I think this is it.. neovim/neovim#15632

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

@rebelot thank you use {'honza/vim-snippets', rtp = '.'} helped resolved the issue
However @quangnguyen30192 I also noticed that the I am not able to circulate the snippet placeholders using tabs like it was working before. Its not even working in the neovim stable release. When I am typing in the snippet placeholder the autocompletes are popping up while I am typing. On completion I am not able to use the tabs to move to the next placeholder.

from cmp-nvim-ultisnips.

rebelot avatar rebelot commented on August 16, 2024

However @quangnguyen30192 I also noticed that the I am not able to circulate the snippet placeholders using tabs like it was working before. Its not even working in the neovim stable release. When I am typing in the snippet placeholder the autocompletes are popping up while I am typing. On completion I am not able to use the tabs to move to the next placeholder.

You’re welcome, maybe opt=true should also work and might be more elegant. My two cents on “supertab”: just use <c-j>/<c-k> and stop bothering rewriting your config every other day. After a few hours you think it’s working, then you notice macros don’t work anymore, you manage to fix it, then you update neovim or cmp and you have to start again. The amount of issues and config bloatware related to tab mappings is fenomenal.

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

@rebelot I have tried putting opt=true but doesn't seem to be working - I have tried use {'honza/vim-snippets', rtp = '.', opt=true}
Am I correct in doing it . Pardon me if this is a trivial clarification. I am new to this.

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

@Trid-collab probably you need to set

vim.g.UltiSnipsRemoveSelectModeMappings = 0

or

let g:UltiSnipsRemoveSelectModeMappings = 0

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

The done the same but still the place holder issue remains. I was also reverted back to the stable version

This is my plugin setup
use({
"SirVer/ultisnips",
requires = { "honza/vim-snippets" },
config = function()
vim.g.UltiSnipsRemoveSelectModeMappings = 0
end,
})

and my cmp mapping setup

mapping = {
	["<C-p>"] = cmp.mapping.select_prev_item(),
	["<C-k>"] = cmp.mapping.select_prev_item(),
	["<C-n>"] = cmp.mapping.select_next_item(),
	["<C-j>"] = cmp.mapping.select_next_item(),
	["<C-d>"] = cmp.mapping.scroll_docs(-4),
	["<C-f>"] = cmp.mapping.scroll_docs(4),
	["<C-e>"] = cmp.mapping.close(),
	["<CR>"] = cmp.mapping.confirm({
		behavior = cmp.ConfirmBehavior.Insert,
		select = true,
	}),
	["<C-Space>"] = cmp.mapping(function(fallback)
		if vim.fn.pumvisible() == 1 then
			if vim.fn["UltiSnips#CanExpandSnippet"]() == 1 then
				return vim.fn.feedkeys(t("<C-R>=UltiSnips#ExpandSnippet()<CR>"))
			end
			vim.fn.feedkeys(t("<C-n>"), "n")
		elseif check_back_space() then
			vim.fn.feedkeys(t("<cr>"), "n")
		else
			fallback()
		end
	end, {
		"i",
		"s",
	}),
	["<Tab>"] = cmp.mapping(function(fallback)
		if vim.fn.complete_info()["selected"] == -1 and vim.fn["UltiSnips#CanExpandSnippet"]() == 1 then
			vim.fn.feedkeys(t("<C-R>=UltiSnips#ExpandSnippet()<CR>"))
		elseif vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
			vim.fn.feedkeys(t("<ESC>:call UltiSnips#JumpForwards()<CR>"))
		elseif vim.fn.pumvisible() == 1 then
			vim.fn.feedkeys(t("<C-n>"), "n")
		elseif check_back_space() then
			vim.fn.feedkeys(t("<tab>"), "n")
		else
			fallback()
		end
	end, {
		"i",
		"s",
	}),
	["<S-Tab>"] = cmp.mapping(function(fallback)
		if vim.fn["UltiSnips#CanJumpBackwards"]() == 1 then
			return vim.fn.feedkeys(t("<C-R>=UltiSnips#JumpBackwards()<CR>"))
		elseif vim.fn.pumvisible() == 1 then
			vim.fn.feedkeys(t("<C-p>"), "n")
		else
			fallback()
		end
	end, {
		"i",
		"s",
	}),
},

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

@quangnguyen30192 I have reverted back to neovim stable. The Ultisnips are showing in the autocomplete now and am able to select.
But the supertab option is not working - in order to circulate between the placeholders. I have tried following the setup in your readme. Whenever I am trying to type something in the placement autocomplete is poping up which I believe hindering the circulation through the placeholders

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Hey thanks, checking it now

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

found out the offending piece of code in cmp setup which was not allowing the tab to work
completion = { completeopt = "menu,menuone,noinsert" }, -- removing this has helped the supertab to work

But even then S-Tab is working weirdly Could you check- Basically when I am circulating back using the S-Tab its going to immediate earlier placeholder but then if we don't re type the placeholder and simply want to go the next above it deletes the placeholder. So say suppose if I am using ife and I come to the last placeholder and want to change the topmost one without changing the second one in between doing S-Tab deletes the one in between which has not been changed

This doesn't happen when using @rebelot's suggestions C-K to go backwards

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

Perfecto. It works. like C-K
Just one question whenever I doing a forward jump or backward jump on the placeholder its printing :call UltiSnips#JumpForward or :call UltiSnips#JumpBackward

Its no harm but just curious
image

Thank you for the quick revert

completion = { completeopt = "menu,menuone,noinsert" }, -- removing this has helped the supertab to work
That's weird, this is the setting recommended by cmp author

You are right I put it after seeing it on the cmp site

Also a question to you and @rebelot does using Utlisnip slow down language server especially pyright compared to Luasbip or others.
I have started liking UltiSnip more because its more rich in snippet options

from cmp-nvim-ultisnips.

Trid-collab avatar Trid-collab commented on August 16, 2024

Thank you

from cmp-nvim-ultisnips.

quangnguyen30192 avatar quangnguyen30192 commented on August 16, 2024

Just one question whenever I doing a forward jump or backward jump on the placeholder its printing :call UltiSnips#JumpForward or :call UltiSnips#JumpBackward

not sure if cmp mapping support silent mode

from cmp-nvim-ultisnips.

smjonas avatar smjonas commented on August 16, 2024

@captainko this is how the guys here hrsh7th/nvim-cmp#241 (comment) fix it

  use {'honza/vim-snippets', rtp = '.'}

@quangnguyen30192 Is this workaround still needed since neovim/neovim#15632 has been merged a while ago? I haven't noticed any problems with vim-snippets while not setting the rtp manually. Can we remove that section from the readme?

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.