Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UltiSnips should pass through any mapping that it currently can't execute as the trigger key #1184

Open
Hritik14 opened this issue Feb 29, 2020 · 5 comments

Comments

@Hritik14
Copy link

@Hritik14 Hritik14 commented Feb 29, 2020

Ultisnips plays very good with for selection but when I map for selection, no longer triggers newline in insert mode. It would be nice to have do both as does because it feels natural to step through the completion suggestions (YCM here) using and ultisnips stops at the first snip suggestion and starts the snip while using

  1. let g:UltiSnipsExpandTrigger = "<CR>"
  2. in insert mode, some text <CR>
  3. no newline

PS: There seems to be one possible solution on stackoverflow: https://vi.stackexchange.com/questions/2757/triggering-ultisnips-with-enter but it would be nice to have that in-built.

  • Operating System: Archlinux
  • Vim Version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jan 26 2020 11:45:38)
    Included patches: 1-148
  • UltiSnips Version: 129d33f
  • Python inside Vim: 3.8.1
@SirVer
Copy link
Owner

@SirVer SirVer commented Mar 2, 2020

Seems to me that the linked solution is perfectly viable. It is unfeasible for UltiSnips to play around any potential combination of behaviors people want to overload. Coding your own binding seems the correct approach. Do you disagree?

@Hritik14
Copy link
Author

@Hritik14 Hritik14 commented Mar 2, 2020

True but it is the default behavior of <tab> to trigger the snip and that causes problems with popular completion engines like YCM. If we could choose a default that works out of the box, it would be better for newcomes to just change what they want to be changed yet the plugin works unchanged.

@SirVer
Copy link
Owner

@SirVer SirVer commented Mar 3, 2020

So to understand correctly, the suggested feature request here is that UltiSnips passes through whatever mapping it has if it cannot fullfill an action. In this case, if it cannot expand at the current position, it should actually insert a literal <cr>, right?

@Hritik14
Copy link
Author

@Hritik14 Hritik14 commented Mar 3, 2020

@SirVer
Copy link
Owner

@SirVer SirVer commented Mar 9, 2020

That sounds reasonable. No idea how hard that is to implement though. Patch is always welcome!

@SirVer SirVer changed the title Ultisnips and YCM, use <CR> for selection UltiSnips should pass through any mapping that it currently can't execute as the trigger key Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.