E486: Pattern not found: +>
I like the idea of a minimal plugin like quicktex for writing LaTeX-code within vim a lot - but I have to admit that I'm having troubles with it.
I have the following snippet included in my init.vim (I'm using neovim):
let g:quicktex_tex = {
\' ' : "\<ESC>:call search('<+.*+>')\<CR>\"_c/+>/e\<CR>",
\'m' : '\( <+++> \) <++>',
\'italic' : '\\italic{<+++>} <++>',
\'textbf' : '\\textbf{<+++>} <++>',
\'frame' : "\\begin{frame}\<CR><+++>\<CR>\\end{frame}",
\'itemize' : "\\begin{itemize}\<CR><+++>\<CR>\\end{itemize}",
\'itm' : '\item ',
\}
After :set ft=texI'm trying to write a command in insert mode as I specified above (e.g. \frame), but instead of the snippet appearing I'm getting the error E486: Pattern not found: +>. In addition, I get out of insert mode and the string +> is highlighted.
I tried disabling all of the other plugins I'm using but this didn't change anything. I'm using Debian Stable and neovim v0.3.4 as well as the current version on the quicktexplugin.
Any ideas?
Hm, I'm having trouble recreating this. Try removing the first entry in the dictionary (the one for the word ' '). After doing that, what happens if you try to type "frame" and then a space inside of a tex file?
On Wed, Oct 21, 2020 at 8:34 AM n0542344 [email protected] wrote:
I like the idea of a minimal plugin like quicktex for writing LaTeX-code within vim a lot - but I have to admit that I'm having troubles with it.
I have the following snippet included in my init.vim (I'm using neovim):
let g:quicktex_tex = { ' ' : "<ESC>:call search('<+.*+>')<CR>"_c/+>/e<CR>", 'm' : '( <+++> ) <++>', 'italic' : '\italic{<+++>} <++>', 'textbf' : '\textbf{<+++>} <++>', 'frame' : "\begin{frame}<CR><+++><CR>\end{frame}", 'itemize' : "\begin{itemize}<CR><+++><CR>\end{itemize}", 'itm' : '\item ', }
After :set ft=texI'm trying to write a command in insert mode as I specified above (e.g. \frame), but instead of the snippet appearing I'm getting the error E486: Pattern not found: +>. In addition, I get out of insert mode and the string +> is highlighted.
I tried disabling all of the other plugins I'm using but this didn't change anything. I'm using Debian Stable and neovim v0.3.4 as well as the current version on the quicktexplugin.
Any ideas?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brennier/quicktex/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEG4GURMLQQUMEELTOXY3JLSL3PNDANCNFSM4SZZJX7Q .
On Wed, Oct 21, 2020 at 8:34 AM n0542344 wrote:
[...] I'm trying to write a command in insert mode as I specified above (e.g. \frame), but instead of the snippet appearing I'm getting the error E486: Pattern not found: +>. In addition, I get out of insert mode and the string +> is highlighted. [...]
On Wed, 2020-10-21 (w43) 07:38:07, Bennett Rennier wrote:
Hm, I'm having trouble recreating this. Try removing the first entry in the dictionary (the one for the word ' '). After doing that, what happens if you try to type "frame" and then a space inside of a tex file?
When I comment the first line the autocommand doesn't work anymore. But what I just discovered is that with the original setup if I type only "frame" everything works as expected, only if I type "\frame" I'm having these hickups.
To me that issue is now solved since now I know that I'm not allowed to use backslashes (quite a change compared to writing regular LaTeX;). Thanks for your quick support!
I'm glad that things worked out! A big motivation for the development of QuickTex was to limit all of the difficult-to-type characters (like backslashes, braces, and brackets), so that users can focus on writing actual content. However, I would avoid using words like "frame" as keywords, since there's a good chance you will need to use that word in a document. I would suggest changing the keyword to either some type of personal abbreviation (such as 'begframe' for "begin frame") or to '\frame' with the backslash (as you originally intended). In my experience, the math dictionary is the only dictionary where using real English words as keywords makes sense.
Also, you cannot place a comment inside of a dictionary. Since Vim uses the " symbol for comments, the parser can get easily confused. This is especially true inside of multi-line commands, such as creating a dictionary.
In any case, I'm going to keep looking into this problem, since this shouldn't be an error in the first place. Let me know if you have any other problems!
On Wed, Oct 21, 2020 at 9:59 AM n0542344 [email protected] wrote:
On Wed, Oct 21, 2020 at 8:34 AM n0542344 wrote:
[...] I'm trying to write a command in insert mode as I specified above (e.g. \frame), but instead of the snippet appearing I'm getting the error E486: Pattern not found: +>. In addition, I get out of insert mode and the string +> is highlighted. [...]
On Wed, 2020-10-21 (w43) 07:38:07, Bennett Rennier wrote:
Hm, I'm having trouble recreating this. Try removing the first entry in the dictionary (the one for the word ' '). After doing that, what happens if you try to type "frame" and then a space inside of a tex file?
When I comment the first line the autocommand doesn't work anymore. But what I just discovered is that with the original setup if I type only "frame" everything works as expected, only if I type "\frame" I'm having these hickups.
To me that issue is now solved since now I know that I'm not allowed to use backslashes (quite a change compared to writing regular LaTeX;). Thanks for your quick support!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brennier/quicktex/issues/26#issuecomment-713639588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEG4GUSFTO7IJHYVCJLTYJDSL3ZNBANCNFSM4SZZJX7Q .