Questions tagged [delimiter-matching]

42 questions
9
votes
1 answer

How to make matchpairs not match closing '>' in "<(>)" while still matching it in "<()>"?

I'm using set matchpairs+=<:> with my C++ code, and it works great. But there are some cases where it is not quite there, like this C++ code: #include template typename std::enable_if<(X>9),int>::type func() { return 5; } int…
Ruslan
  • 475
  • 2
  • 12
4
votes
1 answer

How can I stop [Neo]Vim from tracking parens in certain situations?

Whenever I have to do things like this: closeparens = ")]}" or /[)\]}]/ it messes up the parenthesis tracking of the whole file. I could mitigate this with comments: # complement to ([{ (this is not at all to help with vim's highlighting) local…
phicr
  • 693
  • 5
  • 8
2
votes
0 answers

Getting delimitMate to yield tex-quotes

Typing ` with delimitMate gives ``. But in tex files, it should produce `' . Can it be told to do so? PS. I found that this is easy with AutoPairs: let g:AutoPairs={'`': "'", '"': '"', '{': '}', '''': '''', '(': ')', '[': ']'}
Toothrot
  • 3,129
  • 13
  • 27
2
votes
1 answer

Distinguish between patterns that are inside open delimters and those that are not

I'm not sure of the right language here, but I need to modify all occurrences of a pattern (specifically &) that occur inside a pair of delimiters while leaving unmodified the pattern if it is 'outside all open delimiters'. With apologies,…
Leo Simon
  • 715
  • 1
  • 5
  • 11
1
vote
2 answers

Jumping to open paren with % doesn't work when open paren followed by $ and cursor is in method call experssion

Neovim .6.1 Got this line: add_post_meta($this->cmr_id, 'intro_paragraph', 'Hello'); With: add_post_meta($this->cmr_id, 'intro_paragraph', 'Hello'); ^ cursor here Hitting '%' key jumps to opening paren as…
StevieD
  • 1,492
  • 1
  • 16
  • 24
1
vote
3 answers

Remove look ahead behaviour on match brackets (%)

If your cursor is on top of a "{", pressing % will send it to its matching "}". I like that behaviour. However, if your cursor is behind a "{", pressing % will "look ahead", and also send the cursor to its matching "}". I'd prefer if vim only…
Luiz Martins
  • 457
  • 2
  • 9
0
votes
1 answer

Match a pattern within matching delimiters

I'm trying to match a pattern only when it occurs between matching delimiters For example, in the lines below, I'd like to match the a in the first line, but not the a in the second, which is not inside matching parens ( a ) ( b ) a ( b ) The…
Leo Simon
  • 715
  • 1
  • 5
  • 11