Using Vim to Replace try
with the Safe Navigation Operator
Ruby 2.3.0 added the Safe Navigation Operator (&.
). It allows try
to be replaced with a more elegant looking syntax.
This seemed like a natural job for Vim’s substitute command.