vim-matchup icon indicating copy to clipboard operation
vim-matchup copied to clipboard

Ignore brackets for particular motions

Open oxiedi opened this issue 4 years ago • 2 comments
trafficstars

Hello,

is it possible to ignore brackets for these motions: [%, ]%, i%, a%, z% (i.e. all except % and g%) somehow? Given this piece of Lua code as an example:

if true then print({['key'] = 'value'}) end
|                 ||| |
4                 ||1 0
                  |2 
                  3  

I'd like [% jump directly to 4, skipping 1, 2 and 3.

Could be a good alternative to the builtin [{ and ]} motions for languages that don't use curly brackets to denote a block of code.

oxiedi avatar Dec 17 '20 13:12 oxiedi

Is it safe to assume you'll want to ignore symbols like {[( but jump to all active words like if, function, etc..?

andymass avatar Dec 17 '20 18:12 andymass

Yes. And don't ignore these symbols for % and g% (I haven't showed that in the example).

oxiedi avatar Dec 17 '20 21:12 oxiedi