Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [delimiter-matching]

The tag has no usage guidance.

1
vote
2answers
79 views

How to match braces or brackets?

Suppose I want to search for things like \todo{English sentence} Then the regex \\todo{\_.\{-}} works (I don't know why. I copied it from somewhere long time ago (embarrassed)). But suppose I ...
0
votes
1answer
51 views

Enable %-key jumping/highlighting for backticks (`) and single-quotes (') in M4 files

Background When working on .c and .h files, I have a couple options turned on, namely: filetype plugin on filetype indent on autocmd BufEnter *.c setlocal tabstop=8 shiftwidth=8 softtabstop=8 ...
3
votes
1answer
68 views

Changing the color of delimited text

I am editing text of the form first line second line \note{ first line second line } I have to leave intact the text that's delimited by curly brackets and edit the text that's not delimited. But ...
6
votes
1answer
222 views

Highlighting after a line limit

I'd like to highlight sections of a document which are too long (measured in lines) so they will all print on a physical page. Sections are separated with ===. I tried to do it with this code: ...
0
votes
1answer
81 views

How do you sort lines by longest substring to shortest substring?

Here are some sample strings, sorted by longest string to shortest sting: "Bi(NO<sub>3</sub>)<sub>3</sub>·5H<sub>2</sub>O","bismuth nitrate pentahydrate"); "Be(C&...
3
votes
1answer
137 views

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 ...
0
votes
2answers
237 views

DelimitMate Plugin: How can I specify my own delimiters? Also, can I jump the cursor to the end of the generated right-delims with an insert-mode map?

Two questions related to the DelimitMate plugin here: How can I modify the set of auto-generated left and right delimiters? For example, in LaTeX it would be convenient to have $ as left-right ...
9
votes
1answer
111 views

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 <type_traits> template<int X> ...
1
vote
0answers
162 views

DelimitMate plugin for vim not working

I am new to vim, so I installed the plugin DelimitMate to my vim. But it is not working in my vim -version 7.4.1689.My plugin manager in pathogen.I searched on everywhere to solve this problem but ...
2
votes
1answer
70 views

How to select the content within brackets including brackets and without including brackets?

I have some code structure e.g { { // Some content goes here } [ // Some content goes here ] } I want to select the content inside { } in some case and also content inside with ...
4
votes
3answers
243 views

How move cursore “past the first paired delimiter” (quote, parentheses, etc) - searchpair()?

What is the best way to bind key, to go "past the last delimiter. I want to bind, for example <leader>, to behave like this: "foo bar| baz" -> key press -> "foo bar baz",| (arg1, arg2, |arg3) ->...
0
votes
1answer
591 views

Substitute words enclosed between comma or open-parenthesis and comma or closed parenthesis

I have lines like the following ones (actually function prototypes) void () word ( word, another word, one_more word, ..., hello, ... ) one argument ( only ) I want to match each single argument and ...
2
votes
1answer
149 views

with matchit installed %match parenthesis and brackets only once in Fortran files

At the moment I'm writing, I removed the matchit plugin and the % works well, making the cursor jump from a (, [, or { to the corresponding closing character and vice versa. Now I installed matchit ...
0
votes
0answers
144 views

Matchit Plugin: issues when resetting regular expressions in “b:match_words” for detecting Matlab file keywords

I'm trying to implement a custom regexp string to be used by matchit.vim for identifying matching keywords that can be jumped between with %. I found a utility from FileExchange (in the ftplugin ...
9
votes
1answer
950 views

How can I highlight matching “%” names (e.g. if/end, for/end) defined by matchit.vim on selection?

Currently my Vim highlights matching parentheses, brackets, quotes, etc. with Cyan background and white foreground -- the cursor can be moved between these with %. Thanks to my matchit.vim, I can also ...
3
votes
1answer
100 views

Start of match \zs seems to break my pattern

I am playing around with vim syntax, matching expressions like name.subname regardless of their layout. Here is a match pattern I came upon which does exactly what I want: Now, I wish that subname ...
3
votes
1answer
437 views

Make Vim highlight the match for the paren *before* the cursor

I've had a look at :h matchparen, and it doesn't seem to have an option for highlighting the match for the parenthesis immediately before the cursor. In short, this is what I want: Matchparen should ...
11
votes
7answers
2k views

How to search for lines matching current line in vim

I usually search for words by :/string, but if I have to search entire current line, how to do that. event: 1 beacon: 0x02 //line 1 event: 19 beacon: 0x02 //line 2 event: 1 ...
4
votes
3answers
784 views

matchpairs makes vim slow

I use set matchpairs+=<:> in my config (to help when editing HTML, for instance), but I just noticed it made vim very slow when editing emails. Is there a way to have this setting without ...
1
vote
0answers
45 views

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={'`': "'", '"': '"', '{': '}', '''':...
2
votes
1answer
55 views

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 '...
0
votes
1answer
178 views

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 ...
1
vote
1answer
96 views

Globally replace text contained in curly braces

Unfortunately, I have to convert code created by mathtype into real latex code. My converted creates hideous expressions like \textstyleMTConvertedEquation{{\textbackslash}[\{X\_k\} {\...
6
votes
3answers
223 views

Make % jump between identical delimiters

I use Vim to edit LaTeX files frequently. I want to use % to jump between matching $ which can be used to delimit where mathematical expressions are written. I have tried using matchit and, ...
3
votes
2answers
155 views

How do I search for line containing an unclosed parenthesis?

How to search for line containing unclosed parenthesis. /([^)]*$ works only for non-nested parenthesis. If the closing parenthesis is present in the next lines, it should still be a match. for ...
14
votes
2answers
230 views

Automatically add a closing " or ' when inserting one, but only if the cursor isn't inside a string already

I've defined mappings in my vimrc to automatically enter close parentheses and braces when I enter opening ones with inoremap ( ()<esc>i. I'd like to do the same for " and ', but only when the ...
41
votes
3answers
8k views

How to jump between matching HTML/XML tags?

How to jump between matching tags (such as <div>, <span>, etc.) when editing HTML/XHTML/XML documents similarly as % is used to jump between matching parentheses?
8
votes
2answers
184 views

Automatically delete closing pair without causing unbalanced pairs

I am writing a VimL function that, in insert mode, allows a <BS> through the opening part of a pair ([, {, etc.) to delete the closing part of the pair if it is the next character after the ...
9
votes
1answer
110 views

Can I force parentheses matching to show up across multiple windows?

I have a source file containing a long list of deeply nested heterogenous structures. Since the structures are long, I would like to: Use the :split command to split the screen into two. Scroll down ...