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 custom characters to be autoclosed #9
Comments
Yes, of course! Sorry but I don't know latex. |
The rules would be the same as you already have right now for '(', ' and ". In my case, I would add '$' to this list of custom characters and everytime I time $ I would get |
Sorry, I found a bug related '$' character. " Please add below in your vimrc
call lexima#add_rule({'char': '$', 'input_after': '$', 'filetype': 'latex'})
call lexima#add_rule({'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': 'latex'})
call lexima#add_rule({'char': '<BS>', 'at': '\$\%#\$', 'delete': 1, 'filetype': 'latex'}) You will get
|
To get it to work I added the following to my .vimrc For anyone interested in this, see my mateusbraga/vimconfig. Thanks! |
I am reopening this because I think there is a bug in the add_rule. If I put the calls outside of the autocmd, it does not work. Rephrasing: Adding the following lines to .vimrc does not work even when filetype=tex.: But adding the lines from the previous comment work. I think it is related to your plugin checking the filetype before it is actually set, but I don't know if that is true. |
I noticed that call lexima#add_rule({'char': '$', 'input_after': '$', 'filetype': ['tex', 'plaintex']})
call lexima#add_rule({'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': ['tex', 'plaintex']})
call lexima#add_rule({'char': '<BS>', 'at': '\$\%#\$', 'delete': 1, 'filetype': ['tex', 'plaintex']}) |
Still not working. |
Sorry, this is a bug in lexima's initialization. |
I have fixed. Please try again. |
Adding the following to .vimrc now works: call lexima#add_rule({'char': '$', 'input_after': '$', 'filetype': 'tex'}) Thanks! |
Is it possible to allow for adding custom characters to be autoclosed by lexima?
For example, I would like to add '$' to be autoclosed when working on latex files.
The text was updated successfully, but these errors were encountered: