-
Notifications
You must be signed in to change notification settings - Fork 391
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
Add vimtex-env-create #2489
Comments
Thanks for the kind words! :)
I've previously thought this should be left to a snippet engine. However, I can see that this, although solveable by a snippet engine, could also warrant a feature of its own in VimTeX. We would want this workflow, right:
Perhaps we should call it |
I'm using UltiSnips too and I've found a workaround for wrapping around some selected text using some mapping here. You could adapt it to wrap around as an environment. In my
In my
|
@cnut1648 Any comments about my suggestion? |
Hi @lervag, this sounds really great! This is exactly what I was looking for. The indentation part is good, as for now I have to manually add the indentation in the snippet engine. |
@Alexandre867 oh interesting. I never knew we can make non-ascii characters the trigger. This certainly gives us more options for this functionality. But I personally still feel a vimtex built-in is easier to manage. |
I've added an initial version of this. Please test and give some feedback. The relevant docs: |
Thanks @lervag! I've been using it for a day and it is good!! |
Glad to hear it! |
I've been using an older version of VimTeX and got used to pressing for environment insert. I switched to the newest version and I'm glad to see it's back, though mapped to , but that's not a problem. A great feature. |
First of all, I have been using vimtex for a few days and this plugin is absolutely amazing!!!! Thank you so much for this plugin and it makes my note-taking experience better than ever!!
Is your feature request related to a problem? Please describe it.
Currently there is a
vimtex-cmd-create
which is mapped toF7
by default. I personally find it very useful in that I can visually select text and hit oneF7
to wrap the whole selected text in a command.I think it will be equally useful if we can have a counterpart for environment so that users can also wrap selected text in an environment.
Describe the solution you'd like
Add a
vimtex-env-create
command.Describe alternatives you've considered
My current workaround is to use Utisnips, here is my snip:
To do so I would have to first enter into visual mode, select text, hit
tab
and typebeg
andtab
again, which is ok but a little annoying. Withvimtex-env-create
command I can map it to, say,<F5>
and voila.Thank you for reading.
The text was updated successfully, but these errors were encountered: