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

how to configure for snippets with choice list in json? #194

Open
thudjx opened this issue Jul 15, 2022 · 0 comments
Open

how to configure for snippets with choice list in json? #194

thudjx opened this issue Jul 15, 2022 · 0 comments

Comments

@thudjx
Copy link

thudjx commented Jul 15, 2022

I am using friendly-snippets to provider snippets for luasnip, following the repository. But I don't know how to config the neovim so that it works well for snippets with choice list, e.g.,

"set font size": {
	"prefix": "fontsize",
	"body": "${1|\\Huge,\\huge,\\LARGE,\\Large,\\large,\\normalsize,\\small,\\footnotesize,\\scriptsize,\\tiny|}",
	"description": "Select a font size"
},

When I type fontsize and <CR>, the choice list doesn't show up and it is always the first choice, i.e., \Huge typed.
I have tried to add the codes here to my configuration.This time when I type fontsize and <CR>, the choice list pops up, as shown here:
image
But I can't do anything from now on.
I thought we should add some keymap to handle this event, so I tried to read the documentation of luasnip but found it is lengthy and mainly on the snippets defined in the lua way, rather defined in a json file. So I am wondering is it possible to fix this problem based on the beloved configuration I have followed so far here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant