-
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
Is there any way to use tsd
to toggle delimiters in insert mode?
#2445
Comments
I've pushed a minor fix just now. With this, you can create that map yourself. The following example should work: imap <f7> <esc><plug>(vimtex-delim-toggle-modifier)a I would add this in one of two ways:
This way, you only apply the mapping when VimTeX is loaded. |
That works. However, it will change the position of the cursor. Here is an example. imap <f7> <esc><plug>(vimtex-delim-toggle-modifier)a $$
(aaa)<cursor>
$$ Then press F7. $$
\left(aaa\right)<cursor>
$$ Press again. $$
(<cursor>aaa)
$$ |
Sorry, there was a minor error in the positioning calculation. I've fixed it now, please test again. |
That works. But still has a minor issue. $$
\{aaa\}<cursor>
$$ Then press F7. $$
\left\{aaa\right\<cursor>}
$$ Press again. $$
\{aaa\<cursor>}
$$ |
Thanks; nice edge case. I'll fix it as soon as I get the time! |
I believe this should be fixed now, please test. |
Thanks! Works now. |
Great, glad to hear it! |
Is your feature request related to a problem? Please describe it.
<plug>(vimtex-delim-toggle-modifier)
is useful. However, it will be better if I can toggle it as soon as I insert delimiters in insert mode.Describe the solution you'd like
Support using
<plug>(vimtex-delim-toggle-modifier)
or any other way to enable a key mapping for insert mode.Thanks!
The text was updated successfully, but these errors were encountered: