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

Some TeX snippets don't expand according to config #1430

Open
angelus2014 opened this issue May 14, 2022 · 2 comments
Open

Some TeX snippets don't expand according to config #1430

angelus2014 opened this issue May 14, 2022 · 2 comments

Comments

@angelus2014
Copy link

angelus2014 commented May 14, 2022

I just started (so please excuse if this is a stupid question) using vim-snippets (Neovim 0.7.0) with ultisnips, but I've noticed that with LaTeX (tex.snippets), there are several that expand differently.
For example 'bf' expands to '\bf{}' even though in the config it states:

snippet bf "Bold" wi
  1 \bf{${1:${VISUAL}}}$0
  2 endsnippet

Also, shouldn't 'bf' be 'textbf' as with 'bf' the rest of the text will be bold, not just the text inside the brackets...... When using just bf, it should be {\bf text-one-wants-in-bold}.


With regards,

Angelo Machils

@RiMillo
Copy link

RiMillo commented Jul 26, 2022

For what is worth, I agree: the \bf syntax is awkward and it is not correct, a workaround might be to switch \bf and the opening brace as follows: {\bf ${1:${VISUAL}}}. All in all, personally, I do prefer \textbf{}. In fact, a quick search through the history shows that it used to be implemented version until a couple of months ago, commit ddcda4f; notice that since then, more recent commits reverted some changes applied by the former. Actually, the original snippets are still presents in snippets/tex.snippets, however they are overridden by those in UltiSnips (if you are using UltiSnips, I guess).

Notice also that similar problems hold for snippets it, rm, un

@oeyoews
Copy link

oeyoews commented Aug 15, 2022

if you not set like this

vim.g.UltiSnipsSnippetDirectories = {
  vim.fn.stdpath("data") .. "/site/pack/packer/opt/vim-snippets/UltiSnips/"
}

in default, this ultisnip plugin load this snippets/ directory, not the Ultisnips/ directory, this will not be overwritten by Ultisnips/ directory @angelus2014

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

3 participants