Skip to main content

Questions tagged [match]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
70 views

How do I make Vim do spell-check only in words that beings with [a-zA-Z] and continues on with [a-z]?

Suppose I am writing in a markdown file, and I am using odd naming conventions like 'thisFileNameIsGood'. Spell checker will also mark it as wrong along with the names that the spell checker doesn't ...
souraj ghosh's user avatar
2 votes
3 answers
135 views

Define a match group for a modeline

Looking to define a match group for modelines. vim defines two patterns for modelines: The first form: [text{white}]{vi:|vim:|ex:}[white]{options} [text{white}] empty or any text followed by at least ...
Matthew Webb's user avatar
1 vote
0 answers
47 views

Interaction between zero-width matchers and backreferences

Take a file with the following text as a workbench. hello world hello world With the cursor at the beginning of the line, here's how \1 interacts with \(…\), \@=, and \@! # regex matched text text ...
Enlico's user avatar
  • 2,224
1 vote
1 answer
54 views

Syntax highlighting of a submatch

I have the following syn match specialNumber /1/ contained syn match normalNumber /\d/ contained syn match line /^\d$/ contains=specialNumber,normalNumber hi def link ...
xvf99680's user avatar
1 vote
1 answer
60 views

How to delete match group?

Say I called: matchadd('my_group', 'regex1') and: matchadd('my_group', 'regex2') I know I could matchdelete() on id, but how could we delete match of my_group?
Qiu Yangfan's user avatar
0 votes
1 answer
51 views

What is the shortest search pattern that matches nowhere?

This is mostly a curiosity-driven question. I can't think of anything shorter than x\@=y, which tries to match x and y at the same position. A slightly longer, but probably more self-explaining ...
Enlico's user avatar
  • 2,224
0 votes
0 answers
59 views

Matchpairs not working?

I'd like to match pairs in nvim and have the following code: vim.opt.matchpairs:append("❪:❫") vim.opt.matchpairs:append("⟮:⟯") vim.opt.matchpairs:append("❨:❩") However, ...
Alois Pichler's user avatar
0 votes
2 answers
119 views

How can copy the matched string into register +?

For the below data: -150000 2023-03-30 421.67 2023-04-20 575 2023-05-20 I can substitute the whole line with the first string :%s/\v.{-1,}\s+(.+)/\1 Then the content was changed into: -...
showkey's user avatar
  • 1,150
0 votes
3 answers
44 views

Replace all occurrences of ' 1 ' with matched text in one line

I've got a text file, containing following lines <a href="tg://proxy?server=radan.rooznameh.etellaate.rooz.romatism.sbs&port=443&secret=...
wl2776's user avatar
  • 360