How can we delete this if / end pair and everything inside it?
if
end
def foo if bar # blah # blah # blah # blah end end
d% will do it.
d%
d
%
As you might guess, :h % will tell you more.
:h %
Note: this behavior requires that you enable vim's built-in matching plugin like so: runtime macros/matchit.vim.
runtime macros/matchit.vim