Skip to main content

Questions tagged [plugin-matchit]

This plugin makes the "%" command jump to matching HTML tags, if/else/endif in Vim scripts, etc.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

How to match HTML elements inside a here-doc in perl?

I have a PHP file hello.php that contains the following code: <?php $heredoc = <<<HTML <html> <body> <table> <tr> <td>I AM THE TABLE.</...
MrSnrub's user avatar
  • 431
2 votes
0 answers
116 views

Move cursor to matching goto/jump/label

Goto/label statement pairs are available in C++, Visual Basic, JavaScript, Fortran, and other languages, too. The unique word or number allows goto to find the associated label. How can I help vim ...
Micah Lindstrom's user avatar
1 vote
0 answers
84 views

Highlight html/xml tags using only matchit and matchparen

I would like to highlight html and xml tags, but most plugins I find (e.g. vim-matchup) look like they do way more than I'd like, which I'd like to avoid. Is it possible to highlight the tags by using ...
ElPC's user avatar
  • 31
2 votes
1 answer
184 views

Matching parentheses in tex files

I am relatively new to vim, but I'm trying to get acquainted. I use vim mainly for .tex files and on two different machines (office and home). In both cases, I use Vim-Latex. No problem on the machine ...
Aschkal's user avatar
  • 131
1 vote
0 answers
76 views

matchit matches tags, but does not highlight

In my fortran, ftplugin, I have added packadd matchit, which matched do/end do tags and % do jump from beginning to end. But it doesnot highlight the lines. Is there an easy way of doing it? I mean I ...
BaRud's user avatar
  • 491
2 votes
1 answer
86 views

Using 'd%' to delete a bracket pair and its contents is now broken

I've long been editing code in Vim 7.4 with matchit and matchparen plugins. In my old setup it was easy to delete { some string } by placing the cursor on the { and then use the d% command. I've now ...
D Culley's user avatar
2 votes
2 answers
728 views

Is there an instant way of editing matching inner tags?

In Vim, using the text object i>, you can edit an inner tag, and using the built-in matchit plugin, you can even use % to jump between matching opening and closing tags. Let's say you want to ...
lpf's user avatar
  • 43
2 votes
1 answer
271 views

Alternate ending word in vim matchit pairs

I'm trying to get % to match custom keyword pairs With vim matchit, I can do let b:match_words= \ '\<Start\>:\<Stop\>' to match Start and Stop. I would like to match ...
Petr Skocik's user avatar
3 votes
1 answer
2k views

Matching parenthesis and such not being highlighted in strings since VIM 8.0 on Ubuntu 18.04, how do I get this highlighting back?

When I place the cursor on the parenthesis of the below line, the two parenthesis get highlighted in a cyan color. When I place the cursor on the curly braces, however, no highlighting happens. // ...
Alexis Wilke's user avatar
1 vote
1 answer
184 views

MatchIt not matching anymore if parenthesis, brackets, etc. are between quotes or in comments?

I upgraded to Ubuntu 18.04 and this has Vim version 8.0. This newer version has MatchIt setup to ignore parenthesis, brackets, etc. found inside comments and strings. Although it is at times useful, ...
Alexis Wilke's user avatar
0 votes
1 answer
812 views

Matchit plugin is not working when I put it in my .vimrc. However it works when I run the same command manually inside Vim

I have the following lines in my .vimrc. colorscheme elflord set incsearch set guifont=Monospace\ 13 " <Ctrl-l> redraws the screen and removes any search highlighting. nnoremap <silent&...
user3521633's user avatar
6 votes
1 answer
3k views

How to get matchit to work

I am trying and failing to get matchit to work. I have the plugin at: $ locate matchit.vim /usr/share/vim/vim80/macros/matchit.vim /usr/share/vim/vim80/pack/dist/opt/matchit/plugin/matchit.vim I ...
squarewav's user avatar
  • 171
8 votes
1 answer
1k views

What do matchit.vim's [%, ]%, a% do?

matchit's %/g% are simple enough to use, but I'm having trouble understanding the other mappings, which sound potentially useful but don't seem to work in any understandable way. ]% Go to [count] ...
Mass's user avatar
  • 14.2k
2 votes
1 answer
230 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 ...
Enlico's user avatar
  • 2,244
3 votes
1 answer
838 views

I cannot append a matching pair to b:match_words

I use matchit.vim and it works. Indeed I write a Fortran code and I can jump from IF to END IF pressing %. I'm trying to add the couple <+, > to b:match_words, adding let b:match_words = b:...
Enlico's user avatar
  • 2,244
1 vote
0 answers
342 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 ...
Luke Davis's user avatar
  • 1,397
13 votes
1 answer
3k views

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

Update 2020-07-17: Now I would recommend using the vim-matchup plugin. When matching pair highlighting is turned on, vim-matchup also highlights matching keywords like if/else/endif or while/continue/...
Luke Davis's user avatar
  • 1,397
1 vote
2 answers
1k views

How do I get matchit to work with '/>' (self-closed tags)?

I really like to jump from one <el> to the end of </el> with matchit. I am using it for jsx, but it does not seem to work if I have an element that is declared with />, does anybody ...
philolo1's user avatar
  • 331