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

Excluded Regions for TeX Math #277

Open
avonmoll opened this issue Aug 30, 2018 · 1 comment
Open

Excluded Regions for TeX Math #277

avonmoll opened this issue Aug 30, 2018 · 1 comment

Comments

@avonmoll
Copy link

avonmoll commented Aug 30, 2018

In TeX, I'm using things like \left( x + 2 \right) often. I'm using UltiSnips to create the left-right pairs. I would like for delimitMate to ignore the \left( and not try to automatically close the parenthesis. From the tex syntax definition I discerned that things like \left( and \biggl( are in something like texMathDelimGroup or just texMathDelim. I tried this setting in my .vimrc:

let delimitMate_excluded_regions = "texMathDelim,texMathDelimGroup"

However, I'm still getting autoclosing when I type \left(.

BTW, I also have let delimitMate_smart_matchpairs = ''.

@samoshkin
Copy link

Same issue. Trying to avoid autoclosing pairs for "String" and "Comment" syntax groups, as described in a doc. Unfortunately, it does not work, autoclosing behavior is still in action.

let delimitMate_excluded_regions = "Comment,String"

Then I check my highlight groups for "Comment" and "String". As I'm using "vim-dracula" theme, those syntax groups are linked to Dracula internal groups.

:hi String
String         xxx links to DraculaYellow

:hi Comment
Comment        xxx term=bold ctermfg=14 guifg=#80a0ff
                   links to DraculaComment

Then, I tweaked a config to refer those "Dracula" highlight groups instead. And it works!!!

let delimitMate_excluded_regions = "DraculaComment,DraculaYellow"

AFAIK, in Vim syntax group name (String, Comment) and highlight group are separate concepts. Syntax group indicates a particular token in a text, and can be linked to a highlight group to apply colours.

But turns out this plugin relies upon highlight groups rather than syntax group names. If you're not using any theme, String and Comment group names would work just fine. However, if they are linked by a theme plugin (my case), you have to use aforementioned workaround. Be aware, that this solution makes your vimrc more fragile by putting implicit extra dependency to your current vim theme.

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

2 participants