In C and C-like languages, I can use % to jump to the corresponding curly brace that the cursor is on. This is a well-known trick.But in Ruby for example:def fun    [1, 2].each do |n|    endend This doesn't work, since ruby doesn't use the characters in matchpairs (set to (:),{:},[:],<:> by default.I tried setting that, but it doesn't work::set matchpairs=def:endE474: Invalid argument: matchpairs=def:endCan I get this to work with languages such as Ruby as well? Note this is not a Ruby-specific question, other examples might be shell scripts (if/fi) or Lua (function/end), and many many more.
Using % in languages without curly braces
cursor movement
You can use the matchit plugin. This is included in modern vim distributions, so all you have to do to use it is add the following to your vimrc:runtime macros/matchit.vimYou can also get it packaged as a plugin if you prefer. It recognizes many keywords by default (including def and end) and can be extended to recognize more.