3 ms·
> To be fair though, my vim-memory of using % to bounce between start/end brackets doesn't work in Ruby because of the begin/end words instead of matched symbol
by bhaak 4y ago
> To be fair though, my vim-memory of using % to bounce between start/end brackets doesn't work in Ruby because of the begin/end words instead of matched symbols :(
Put "runtime macros/matchit.vim" into your .vimrc. Or for even better support add the matchup plugin. https://github.com/andymass/vim-matchup https://github.com/andymass/vim-matchup
- mypalmike 4y agoI'm not a vim user, but I think the problem with Ruby here is that it's not begin/end. It's anything that evaluates to an iterable/end.
- bhaak 4y agoYes, that's the problem for plain vi(m) which only supports single character braces. matchit/matchup extends this to language specific delimiter words. This animation https://github.com/andymass/vim-matchup#screenshot https://github.com/andymass/vim-matchup#screenshot shows how you can iterate over multiple sequences like if/elsif/else/endif.